src/GameOfLife/OptionHandler/OptionLoader.php
/**
     * Adds the class specific options from Inputs, Outputs and Rules to the option list.
     *
     * @param Getopt $_options The option list
     * @param String[] $_classPaths The paths to the classes
     * @param String[] $_excludeClasses The classes whose options will not be added to the option list
     * @param String $_nameSpace The name space of the classes
     *
     * @return array List of which options refer to which class
     */
Adds the class specific options from Inputs, Outputs and Rules to the option list.
@param Getopt $_options The option list
@param String[] $_classPaths The paths to the classes
@param String[] $_excludeClasses The classes whose options will not be added to the option list
@param String $_nameSpace The name space of the classes

@return array List of which options refer to which class
Adds the class specific options from Inputs Outputs and Rules to the option list . @param Getopt $_options The option list @param String [] $_classPaths The paths to the classes @param String [] $_excludeClasses The classes whose options will not be added to the option list @param String $_nameSpace The name space of the classes @return array List of which options refer to which class
public function addClassOptions(Getopt $_options, array $_classPaths, array $_excludeClasses, String $_nameSpace): array
    {
        $linkedOptions = array();
        foreach ($_classPaths as $classPath)
        {
            $className = basename($classPath, ".php");
            if (! in_array($className, $_excludeClasses))
            {
                $classIncludePath = $_nameSpace . "\\" . $className;
                $previousOptions = $_options->getOptionList();
                $classInstance = new $classIncludePath;
                $classInstance->addOptions($_options);
                $newOptions = $_options->getOptionList();
                foreach ($this->getOptionsDiff($previousOptions, $newOptions) as $option)
                {
                    $optionName = $option[1];
                    $linkedOptions[$optionName] = $classIncludePath;
                }
            }
        }
        return $linkedOptions;
    }
public function addClassOptions ( Getopt $ _options , array $ _classPaths , array $ _excludeClasses , String $ _nameSpace ) : array { $ linkedOptions = array ( ) ; foreach ( $ _classPaths as $ classPath ) { $ className = basename ( $ classPath , " .php " ) ; if ( ! in_array ( $ className , $ _excludeClasses ) ) { $ classIncludePath = $ _nameSpace . " \\ " . $ className ; $ previousOptions = $ _options -> getOptionList ( ) ; $ classInstance = new $ classIncludePath ; $ classInstance -> addOptions ( $ _options ) ; $ newOptions = $ _options -> getOptionList ( ) ; foreach ( $ this -> getOptionsDiff ( $ previousOptions , $ newOptions ) as $ option ) { $ optionName = $ option [ 1 ] ; $ linkedOptions [ $ optionName ] = $ classIncludePath ; } } } return $ linkedOptions ; }
Adds the class specific options from Inputs, Outputs and Rules to the option list.
Adds the class specific options from Inputs Outputs and Rules to the option list .
// get options before class adds its options /**
                 * @var BaseInput|BaseOutput|BaseRule $classInstance
                 */ // get options after the class added its options