src/GameOfLife/Inputs/BoardEditor/OptionHandler/BoardEditorOptionLoader.php
/**
     * Loads all options from the options folder.
     *
     * @param String $_optionsDirectory Directory in which the board editor options are stored
     *
     * @return BoardEditorOption[] array in the format ("optionName" => "optionObject")
     *
     * @throws \Exception The exception when the options directory was not found
     */
Loads all options from the options folder.
@param String $_optionsDirectory Directory in which the board editor options are stored

@return BoardEditorOption[] array in the format ("optionName" => "optionObject")

@throws \Exception The exception when the options directory was not found
Loads all options from the options folder . @param String $_optionsDirectory Directory in which the board editor options are stored @return BoardEditorOption [] array in the format ( " optionName " = > " optionObject " ) @throws \ Exception The exception when the options directory was not found
public function loadOptions(String $_optionsDirectory): array
    {
        $options = array();
        $classes = $this->fileSystemReader->getFileList($_optionsDirectory . "/*Option.php");
        foreach ($classes as $class)
        {
            $className = basename($class, ".php");
            $classPath = "BoardEditor\\Options\\" . $className;
            $instance = new $classPath($this->parentOptionHandler->parentBoardEditor());
            if ($instance instanceof BoardEditorOption) $options[$instance->name()] = $instance;
        }
        return $options;
    }
public function loadOptions ( String $ _optionsDirectory ) : array { $ options = array ( ) ; $ classes = $ this -> fileSystemReader -> getFileList ( $ _optionsDirectory . " /*Option.php " ) ; foreach ( $ classes as $ class ) { $ className = basename ( $ class , " .php " ) ; $ classPath = " BoardEditor \\ Options \\ " . $ className ; $ instance = new $ classPath ( $ this -> parentOptionHandler -> parentBoardEditor ( ) ) ; if ( $ instance instanceof BoardEditorOption ) $ options [ $ instance -> name ( ) ] = $ instance ; } return $ options ; }
Loads all options from the options folder.
Loads all options from the options folder .
// Load each option from the options folder