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.

ExceptionLogger   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A registerHandlers() 0 6 1
1
<?php
2
3
/**
4
 * Logs errors and exceptions.
5
 *
6
 * @author    Leandro Silva <[email protected]>
7
 *
8
 * @link      http://leandrosilva.info Development Blog
9
 * @link      http://github.com/LansoWeb/LosLog for the canonical source repository
10
 *
11
 * @copyright Copyright (c) 2011-2013 Leandro Silva (http://leandrosilva.info)
12
 * @license   http://leandrosilva.info/licenca-bsd New BSD license
13
 */
14
namespace LosMiddleware\LosLog;
15
16
use Zend\Log\Logger;
17
18
/**
19
 * Logs errors and exceptions.
20
 *
21
 * @author    Leandro Silva <[email protected]>
22
 *
23
 * @link      http://leandrosilva.info Development Blog
24
 * @link      http://github.com/LansoWeb/LosLog for the canonical source repository
25
 *
26
 * @copyright Copyright (c) 2011-2013 Leandro Silva (http://leandrosilva.info)
27
 * @license   http://leandrosilva.info/licenca-bsd New BSD license
28
 * @codeCoverageIgnore
29
 */
30
class ExceptionLogger
31
{
32
    /**
33
     * Registers the handlers for errors and exceptions.
34
     *
35
     * @param string $logFile
36
     * @param string $logDir
37
     * @throws Exception\InvalidArgumentException
38
     */
39
    public static function registerHandlers($logFile = 'exception.log', $logDir = 'data/logs')
40
    {
41
        $logger = AbstractLogger::generateFileLogger($logFile, $logDir);
42
43
        Logger::registerExceptionHandler($logger->getLogger());
0 ignored issues
show
Compatibility introduced by
$logger->getLogger() of type object<Zend\Log\LoggerInterface> is not a sub-type of object<Zend\Log\Logger>. It seems like you assume a concrete implementation of the interface Zend\Log\LoggerInterface to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
44
    }
45
}
46