src/Composer/ComposerHydrationHandler.php
public function getArguments()
    {
        // Checks if script received command arguments.
        $cmdArguments = $this->event->getArguments();
        if (!$cmdArguments) {
            throw new \ErrorException('Hydrate command expects arguments.');
        }

        // Treats arguments.
        $returnArguments = array();
        foreach ($cmdArguments as $cmdArgument) {
            $cmdArgument = explode('=', $cmdArgument);
            $argument = $cmdArgument[0];

            // Checks if the argument exists.
            if (!$this->cmdArgumentExist($argument)) {
                throw new \ErrorException("Command argument '$argument' do not exist.");
            }

            // Treats REPLACE_ARG argument.
            if ($argument == self::REPLACE_ARG) {
                $replaceValues = !empty($cmdArgument[1]) ? $cmdArgument[1] : null;
                if (!$replaceValues) {
                    $msg = 'Command argument "--replace" must contain values, like: --replace="{SEARCH}:{REPLACE},.."';
                    throw new \ErrorException($msg);
                }

                $returnArguments[self::REPLACE_ARG] = $this->getReplaceValuesFromArgument($replaceValues);
            }
        }

        return $returnArguments;
    }
public function getArguments()
    {
        // Checks if script received command arguments.
        $cmdArguments = $this->event->getArguments();
        if (!$cmdArguments) {
            throw new \ErrorException('Hydrate command expects arguments.');
        }

        // Treats arguments.
        $returnArguments = array();
        foreach ($cmdArguments as $cmdArgument) {
            $cmdArgument = explode('=', $cmdArgument);
            $argument = $cmdArgument[0];

            // Checks if the argument exists.
            if (!$this->cmdArgumentExist($argument)) {
                throw new \ErrorException("Command argument '$argument' do not exist.");
            }

            // Treats REPLACE_ARG argument.
            if ($argument == self::REPLACE_ARG) {
                $replaceValues = !empty($cmdArgument[1]) ? $cmdArgument[1] : null;
                if (!$replaceValues) {
                    $msg = 'Command argument "--replace" must contain values, like: --replace="{SEARCH}:{REPLACE},.."';
                    throw new \ErrorException($msg);
                }

                $returnArguments[self::REPLACE_ARG] = $this->getReplaceValuesFromArgument($replaceValues);
            }
        }

        return $returnArguments;
    }
public function getArguments ( ) { // Checks if script received command arguments. $ cmdArguments = $ this -> event -> getArguments ( ) ; if ( ! $ cmdArguments ) { throw new \ ErrorException ( 'Hydrate command expects arguments.' ) ; } // Treats arguments. $ returnArguments = array ( ) ; foreach ( $ cmdArguments as $ cmdArgument ) { $ cmdArgument = explode ( '=' , $ cmdArgument ) ; $ argument = $ cmdArgument [ 0 ] ; // Checks if the argument exists. if ( ! $ this -> cmdArgumentExist ( $ argument ) ) { throw new \ ErrorException ( "Command argument '$argument' do not exist." ) ; } // Treats REPLACE_ARG argument. if ( $ argument == self :: REPLACE_ARG ) { $ replaceValues = ! empty ( $ cmdArgument [ 1 ] ) ? $ cmdArgument [ 1 ] : null ; if ( ! $ replaceValues ) { $ msg = 'Command argument "--replace" must contain values, like: --replace="{SEARCH}:{REPLACE},.."' ; throw new \ ErrorException ( $ msg ) ; } $ returnArguments [ self :: REPLACE_ARG ] = $ this -> getReplaceValuesFromArgument ( $ replaceValues ) ; } } return $ returnArguments ; }
Returns an array containing the command arguments values.

@return array
An array containing the script command arguments.
Returns an array containing the command arguments values .