Conditions | 1 |
Paths | 1 |
Total Lines | 19 |
Lines | 19 |
Ratio | 100 % |
Tests | 10 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
28 | 1 | protected function buildContainer(): Container |
|
29 | { |
||
30 | 1 | $container = parent::buildContainer(); |
|
31 | |||
32 | // Alias the web application to Joomla's base application class as this is the primary application for the environment |
||
33 | 1 | $container->alias(AbstractApplication::class, Application::class); |
|
34 | |||
35 | // Alias the web application logger as the primary logger for the environment |
||
36 | 1 | $container->alias('monolog', 'monolog.logger.cli') |
|
37 | 1 | ->alias('logger', 'monolog.logger.cli') |
|
38 | 1 | ->alias(Logger::class, 'monolog.logger.cli') |
|
39 | 1 | ->alias(LoggerInterface::class, 'monolog.logger.cli'); |
|
40 | |||
41 | // Set error reporting based on config |
||
42 | 1 | $errorReporting = (int) $container->get('config')->get('errorReporting', 0); |
|
43 | 1 | error_reporting($errorReporting); |
|
44 | |||
45 | 1 | return $container; |
|
46 | } |
||
47 | } |
||
48 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.