Ferreteria/v0.6/clade/Sys/Events/InputRq/Setting/@removed

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | Sys‎ | Events‎ | InputRq‎ | Setting
Jump to navigation Jump to search
Removed Code

2025-08-31

Commented out at the start of the month:

// 2025-08-01 never used anywhere:
    static function FromItemValue(ItemIface $oItem, string $sValue) : BaseIface;
    #function Input() : string;

2025-03-10

Commented out 2 days ago:

// 2025-03-08 This is a confusion of concepts. Splitting into OAKeptInput and OAThisInput, with OAFinalInput combining the two.
    private $oIn = NULL;
    protected function OInput() : InDataIface { return $this->oIn ?? ($this->oIn = $this->NewInput()); }
    // DEFAULT: 1:1 copy of input argument
    protected function NewInput() : InDataIface {
        $sKey = $this->NameOfInput();  // the internal key for the subcommand we're processing here
        $sVal = $this->Input();

        $oItDef = $this->Item();
        $oFTags = $oItDef->GetFTags();
        #echo CRLF.$oFTags->Dumper()->Render();

        $oa = new ($this->InputClass());
        $oa->SetIt($sKey,$sVal);
        echo "SETTING [$sKey] TO [$sVal]".CRLF;
        return $oa;
    }

2025-03-09

Commented out yesterday:

// 2025-03-08 Actually, I think here we now want to just save directly to Kept settings.
    private $sInput;
    protected function ParseInputString(string $s) : void { $this->sInput = $s; }
    public function Input() : string { return $this->sInput; }

2025-03-08

Commented out 3 days ago:

/**
     * ACTION: This instar prints a generic "value missing" error message, and then quits.
     *  Podlings can override with more context-specific information or behavior.
     */
    // 2025-03-05 This does not seem to be called by anything anymore.
    public function HandleMissing() : void {
        $oScrn = self::Screen();

        $oItem = $this->Item();
        $ftCues = $oItem->RenderUIName();

        $ftCls = $oScrn->BlueIt(get_called_class());
        echo $oScrn->ErrorIt('Internal Error').": no value specified for option '$ftCues' (class $ftCls).".CRLF;
        die();
    }

2025-01-26

Commented out earlier:

public function Describe() : string {
        $oScrn = self::Screen();
        $oItem = $this->Item();
        $sTName = $oItem->Name();         // tag name
        $sAName = $oItem->NameValue();   // "name" attribute
        $ftAName = $oScrn->BlueIt($sAName);
        $osVal = $this->QSetting();
        if ($osVal->HasIt()) {
            return $this->DescribeHasValue();
        } else {
            self::GotToHere('value not found?');
            return $this->DescribeNonValue();
        }
    }
    protected function DescribeHasValue() : string {
        $oScrn = self::Screen();

        $oItem = $this->Item();
        $sTName = $oItem->Name();         // tag name
        $sAName = $oItem->NameValue();   // "name" attribute
        $ftAName = $oScrn->BlueIt($sAName);

        $sVal = $this->QSetting()->GetIt();
        $ftVal = $oScrn->BoldIt($sVal);
        return "set $sTName [$ftAName] to '$ftVal'";  // TODO: name the item being set, somehow
    }
    /**
     * PURPOSE: handles when a value is not given, but also isn't required
     * INSTAR: default is to show an error and quit
     */
    protected function DescribeNonValue() : string {
        $oScrn = self::Screen();

        $oItem = $this->Item();
        $ftCues = $oItem->RenderUIName();

        $sOut = $this->UserPrompt("You need to enter a value for $ftCues.");
        // TODO: more detailed help for the item (maybe call it RenderHelpText()?)
        $sOut .= ' - '.$oScrn->GreenIt('Usage').': '.$oItem->RenderHelpLine().CRLF;
        $ftCls = $oScrn->BlueIt(get_called_class());
        $sOut .= " - class: $ftCls".CRLF;
        die($sOut);
        return $sOut; // outputs extra CRLFs (2024-12-27 TODO: fix, so we can just return)
    }

2025-01-07

Commented out from Go() on 2024-12-25:

// 2024-12-25 Tentatively, we don't actually need to do anything when we're just saving the option, because InChker_UseValue() already did.
        $osVal = $this->QSetting();
        #echo 'SETTING OPTION CLASS '.get_called_class().CRLF;
        if ($osVal->HasIt()) {
            $sVal = $osVal->GetIt();
            echo "USING VALUE [$sVal] in ".get_called_class().CRLF;
            echo $this->Item()->ReflectThis()->Report(); die();
            $this->Item()->QSetting()->SetIt($sVal);  // set the option's value
        }

2024-12-15

Commented out 2024-12-14:

// 2024-12-14 old version
    public function __construct(private OptionIface $oOption, string $sValue) {
        $sSlug = $oOption->Attrs()->QName()->GetIt();
        parent::__construct($sSlug);
        $this->CheckInput($sValue);
    }