| Total Complexity | 6 |
| Total Lines | 62 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class LogServiceProvider implements ServiceProviderInterface |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Registers services on the given container. |
||
| 13 | * |
||
| 14 | * This method should only be used to configure services and parameters. |
||
| 15 | * It should not get services. |
||
| 16 | * |
||
| 17 | * @param Container $pimple A container instance |
||
| 18 | */ |
||
| 19 | public function register(Container $pimple) |
||
| 20 | { |
||
| 21 | $pimple['logger'] = $pimple['log'] = function ($app) { |
||
| 22 | $config = $this->formatLogConfig($app); |
||
| 23 | |||
| 24 | if (!empty($config)) { |
||
| 25 | $app['config']->merge($config); |
||
| 26 | } |
||
| 27 | |||
| 28 | return new LogManager($app); |
||
| 29 | }; |
||
| 30 | } |
||
| 31 | |||
| 32 | public function formatLogConfig($app) |
||
| 71 | ], |
||
| 72 | ], |
||
| 76 |