*/
protected $config;
-
/**
* @param array $config Configuration data.
*/
public function __construct( array $config ) {
- $this->config = array();
+ $this->config = [];
$this->mergeConfig( $config );
}
-
/**
* Merge additional configuration data into the configuration.
*
$this->reset();
}
-
/**
* Reset internal caches.
*
* be no need to flush the caches.
*/
public function reset() {
- $this->singletons = array(
- 'loggers' => array(),
- 'handlers' => array(),
- 'formatters' => array(),
- 'processors' => array(),
- );
+ $this->singletons = [
+ 'loggers' => [],
+ 'handlers' => [],
+ 'formatters' => [],
+ 'processors' => [],
+ ];
}
-
/**
* Get a logger instance.
*
* name will return the cached instance.
*
* @param string $channel Logging channel
- * @return \\Psr\\Log\\LoggerInterface Logger instance
+ * @return \Psr\Log\LoggerInterface Logger instance
*/
public function getLogger( $channel ) {
if ( !isset( $this->singletons['loggers'][$channel] ) ) {
return $this->singletons['loggers'][$channel];
}
-
/**
* Create a logger.
* @param string $channel Logger channel
* @param array $spec Configuration
- * @return \\Monolog\\Logger
+ * @return \Monolog\Logger
*/
protected function createLogger( $channel, $spec ) {
$obj = new Logger( $channel );
if ( isset( $spec['calls'] ) ) {
foreach ( $spec['calls'] as $method => $margs ) {
- call_user_func_array( array( $obj, $method ), $margs );
+ call_user_func_array( [ $obj, $method ], $margs );
}
}
return $obj;
}
-
/**
* Create or return cached processor.
* @param string $name Processor name
return $this->singletons['processors'][$name];
}
-
/**
* Create or return cached handler.
* @param string $name Processor name
- * @return \\Monolog\\Handler\\HandlerInterface
+ * @return \Monolog\Handler\HandlerInterface
*/
public function getHandler( $name ) {
if ( !isset( $this->singletons['handlers'][$name] ) ) {
return $this->singletons['handlers'][$name];
}
-
/**
* Create or return cached formatter.
* @param string $name Formatter name
- * @return \\Monolog\\Formatter\\FormatterInterface
+ * @return \Monolog\Formatter\FormatterInterface
*/
public function getFormatter( $name ) {
if ( !isset( $this->singletons['formatters'][$name] ) ) {