GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

HttpLogFactory::__invoke()   A
last analyzed

Complexity

Conditions 4
Paths 8

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.2
c 0
b 0
f 0
cc 4
eloc 7
nc 8
nop 3
1
<?php
2
namespace LosMiddleware\LosLog;
3
4
use Interop\Container\ContainerInterface;
5
use Zend\ServiceManager\Factory\FactoryInterface;
6
7
class HttpLogFactory implements FactoryInterface
8
{
9
    /**
10
     * @param ContainerInterface $container
11
     * @param string $requestedName
12
     * @param array|null $options
13
     * @return HttpLog|object
14
     * @throws Exception\InvalidArgumentException
15
     * @throws \Psr\Container\ContainerExceptionInterface
16
     * @throws \Psr\Container\NotFoundExceptionInterface
17
     */
18
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
19
    {
20
        $config = $container->get('config');
21
        $losConfig = array_key_exists('loslog', $config) ? $config['loslog'] : [];
22
23
        $logDir = array_key_exists('log_dir', $losConfig) ? $losConfig['log_dir'] : 'data/logs';
24
        $logFile = array_key_exists('http_logger_file', $losConfig) ? $losConfig['http_logger_file'] : 'http.log';
25
26
        $logger = AbstractLogger::generateFileLogger($logFile, $logDir);
27
28
        return new HttpLog($logger, $losConfig);
29
    }
30
}
31