src/Charcoal/App/Module/AbstractModule.php
public function config($key = null)
    {
        if ($this->config === null) {
            throw new InvalidArgumentException(
                'Configuration not set.'
            );
        }

        if ($key !== null) {
            return $this->config->get($key);
        } else {
            return $this->config;
        }
    }
public function config($key = null)
    {
        if ($this->config === null) {
            throw new InvalidArgumentException(
                'Configuration not set.'
            );
        }

        if ($key !== null) {
            return $this->config->get($key);
        } else {
            return $this->config;
        }
    }
public function config ( $ key = null ) { if ( $ this -> config === null ) { throw new InvalidArgumentException ( 'Configuration not set.' ) ; } if ( $ key !== null ) { return $ this -> config -> get ( $ key ) ; } else { return $ this -> config ; } }
Retrieve the module's configuration container, or one of its entry.

If a key is provided, return the configuration key value instead of the full object.

@param  string $key Optional. If provided, the config key value will be returned, instead of the full object.
@throws InvalidArgumentException If a config has not been defined.
@return \Charcoal\Config\ConfigInterface|mixed
Retrieve the module s configuration container or one of its entry .