src/ImageStack/OptionnableTrait.php
public function getOption($name, $default = null)
    {
        if (!isset($this->options[$name])) {
            if (is_callable($default)) {
                $default = call_user_func($default);
            } if ($default instanceof \Exception) {
                throw $default;
            }
            return $default;
        }
        return $this->options[$name];
    }
public function getOption($name, $default = null)
    {
        if (!isset($this->options[$name])) {
            if (is_callable($default)) {
                $default = call_user_func($default);
            } if ($default instanceof \Exception) {
                throw $default;
            }
            return $default;
        }
        return $this->options[$name];
    }
public function getOption ( $ name , $ default = null ) { if ( ! isset ( $ this -> options [ $ name ] ) ) { if ( is_callable ( $ default ) ) { $ default = call_user_func ( $ default ) ; } if ( $ default instanceof \ Exception ) { throw $ default ; } return $ default ; } return $ this -> options [ $ name ] ; }
Get option value or default or throws exception.
@param string $name
@param mixed|callable|\Exception $default
@throws \Exception
@return mixed
Get option value or default or throws exception .