protected function getConfig($key = null)
    {
        if (!is_null($key)) {
            if (!array_key_exists($key, $this->config)) {
                throw new \InvalidArgumentException('Config key "'.$key.'" does not exist. Valid keys are: "'.implode(', ', array_keys($this->config)).'"');
            }

            return $this->config[$key];
        }

        return $this->config;
    }
protected function getConfig($key = null)
    {
        if (!is_null($key)) {
            if (!array_key_exists($key, $this->config)) {
                throw new \InvalidArgumentException('Config key "'.$key.'" does not exist. Valid keys are: "'.implode(', ', array_keys($this->config)).'"');
            }

            return $this->config[$key];
        }

        return $this->config;
    }
protected function getConfig ( $ key = null ) { if ( ! is_null ( $ key ) ) { if ( ! array_key_exists ( $ key , $ this -> config ) ) { throw new \ InvalidArgumentException ( 'Config key "' . $ key . '" does not exist. Valid keys are: "' . implode ( ', ' , array_keys ( $ this -> config ) ) . '"' ) ; } return $ this -> config [ $ key ] ; } return $ this -> config ; }
Returns all config items or a specific one

@param  null|mixed $key
@return mixed
Returns all config items or a specific one