src/Samurai/Component/Task/Option.php
public function get($key, $default = null)
    {
        if (array_key_exists($key, $this->options)) return $this->valuelize($this->options[$key]);

        foreach ($this->getDefinitions() as $define) {
            // when short option
            if ($key === $define->getShortName()) {
                if (array_key_exists($define->getName(), $this->options)) return $this->valuelize($this->options[$define->getName()]);
                return $this->valuelize($define->getDefault());
            }
            // when long option
            if ($key === $define->getName()) {
                if (array_key_exists($define->getShortName(), $this->options)) return $this->valuelize($this->options[$define->getShortName()]);
                return $this->valuelize($define->getDefault());
            }
        }

        return $this->valuelize($default);
    }
public function get($key, $default = null)
    {
        if (array_key_exists($key, $this->options)) return $this->valuelize($this->options[$key]);

        foreach ($this->getDefinitions() as $define) {
            // when short option
            if ($key === $define->getShortName()) {
                if (array_key_exists($define->getName(), $this->options)) return $this->valuelize($this->options[$define->getName()]);
                return $this->valuelize($define->getDefault());
            }
            // when long option
            if ($key === $define->getName()) {
                if (array_key_exists($define->getShortName(), $this->options)) return $this->valuelize($this->options[$define->getShortName()]);
                return $this->valuelize($define->getDefault());
            }
        }

        return $this->valuelize($default);
    }
public function get ( $ key , $ default = null ) { if ( array_key_exists ( $ key , $ this -> options ) ) return $ this -> valuelize ( $ this -> options [ $ key ] ) ; foreach ( $ this -> getDefinitions ( ) as $ define ) { // when short option if ( $ key === $ define -> getShortName ( ) ) { if ( array_key_exists ( $ define -> getName ( ) , $ this -> options ) ) return $ this -> valuelize ( $ this -> options [ $ define -> getName ( ) ] ) ; return $ this -> valuelize ( $ define -> getDefault ( ) ) ; } // when long option if ( $ key === $ define -> getName ( ) ) { if ( array_key_exists ( $ define -> getShortName ( ) , $ this -> options ) ) return $ this -> valuelize ( $ this -> options [ $ define -> getShortName ( ) ] ) ; return $ this -> valuelize ( $ define -> getDefault ( ) ) ; } } return $ this -> valuelize ( $ default ) ; }
get a option.

@param   string  $key
@return  mixed
get a option .