protected function getArguments(): array
    {
        Factory::helper('string');
        $aArguments = [];

        if (!empty($this->aArguments)) {
            foreach ($this->aArguments as $aArgument) {
                $aArguments[] = (object) [
                    'name'     => getFromArray('name', $aArgument),
                    'value'    => $this->oInput->getArgument(getFromArray('name', $aArgument)),
                    'required' => getFromArray('required', $aArgument),
                ];
            }
        } else {
            $aArgumentsRaw = array_slice($this->oInput->getArguments(), 1);
            foreach ($aArgumentsRaw as $sField => $sValue) {
                $sField       = strtoupper(camelcase_to_underscore($sField));
                $aArguments[] = (object) [
                    'name'     => $sField,
                    'value'    => $sValue,
                    'required' => true,
                ];
            }
        }

        unset($sField);
        unset($sValue);

        foreach ($aArguments as &$oArgument) {
            if (empty($oArgument->value)) {
                $sLabel = str_replace('_', ' ', $oArgument->name);
                $sLabel = ucwords(strtolower($sLabel));
                $sError = '';
                do {
                    $oArgument->value = $this->ask($sError . $sLabel . ':', '');
                    $sError           = '<error>Please specify</error> ';
                    if ($oArgument->required && empty($oArgument->value)) {
                        $bAskAgain = true;
                    } else {
                        $bAskAgain = false;
                    }
                } while ($bAskAgain);
            }
        }
        unset($oArgument);

        //  Finally set as key values
        $aOut = [];
        foreach ($aArguments as $oArgument) {
            $aOut[strtoupper($oArgument->name)] = $oArgument->value;
        }

        return $aOut;
    }
protected function getArguments(): array
    {
        Factory::helper('string');
        $aArguments = [];

        if (!empty($this->aArguments)) {
            foreach ($this->aArguments as $aArgument) {
                $aArguments[] = (object) [
                    'name'     => getFromArray('name', $aArgument),
                    'value'    => $this->oInput->getArgument(getFromArray('name', $aArgument)),
                    'required' => getFromArray('required', $aArgument),
                ];
            }
        } else {
            $aArgumentsRaw = array_slice($this->oInput->getArguments(), 1);
            foreach ($aArgumentsRaw as $sField => $sValue) {
                $sField       = strtoupper(camelcase_to_underscore($sField));
                $aArguments[] = (object) [
                    'name'     => $sField,
                    'value'    => $sValue,
                    'required' => true,
                ];
            }
        }

        unset($sField);
        unset($sValue);

        foreach ($aArguments as &$oArgument) {
            if (empty($oArgument->value)) {
                $sLabel = str_replace('_', ' ', $oArgument->name);
                $sLabel = ucwords(strtolower($sLabel));
                $sError = '';
                do {
                    $oArgument->value = $this->ask($sError . $sLabel . ':', '');
                    $sError           = '<error>Please specify</error> ';
                    if ($oArgument->required && empty($oArgument->value)) {
                        $bAskAgain = true;
                    } else {
                        $bAskAgain = false;
                    }
                } while ($bAskAgain);
            }
        }
        unset($oArgument);

        //  Finally set as key values
        $aOut = [];
        foreach ($aArguments as $oArgument) {
            $aOut[strtoupper($oArgument->name)] = $oArgument->value;
        }

        return $aOut;
    }
protected function getArguments ( ) : array { Factory :: helper ( 'string' ) ; $ aArguments = [ ] ; if ( ! empty ( $ this -> aArguments ) ) { foreach ( $ this -> aArguments as $ aArgument ) { $ aArguments [ ] = ( object ) [ 'name' => getFromArray ( 'name' , $ aArgument ) , 'value' => $ this -> oInput -> getArgument ( getFromArray ( 'name' , $ aArgument ) ) , 'required' => getFromArray ( 'required' , $ aArgument ) , ] ; } } else { $ aArgumentsRaw = array_slice ( $ this -> oInput -> getArguments ( ) , 1 ) ; foreach ( $ aArgumentsRaw as $ sField => $ sValue ) { $ sField = strtoupper ( camelcase_to_underscore ( $ sField ) ) ; $ aArguments [ ] = ( object ) [ 'name' => $ sField , 'value' => $ sValue , 'required' => true , ] ; } } unset ( $ sField ) ; unset ( $ sValue ) ; foreach ( $ aArguments as & $ oArgument ) { if ( empty ( $ oArgument -> value ) ) { $ sLabel = str_replace ( '_' , ' ' , $ oArgument -> name ) ; $ sLabel = ucwords ( strtolower ( $ sLabel ) ) ; $ sError = '' ; do { $ oArgument -> value = $ this -> ask ( $ sError . $ sLabel . ':' , '' ) ; $ sError = '<error>Please specify</error> ' ; if ( $ oArgument -> required && empty ( $ oArgument -> value ) ) { $ bAskAgain = true ; } else { $ bAskAgain = false ; } } while ( $ bAskAgain ) ; } } unset ( $ oArgument ) ; //  Finally set as key values $ aOut = [ ] ; foreach ( $ aArguments as $ oArgument ) { $ aOut [ strtoupper ( $ oArgument -> name ) ] = $ oArgument -> value ; } return $ aOut ; }
Parses the arguments into an array ready for templates

@return array
Parses the arguments into an array ready for templates