Issues (1270)

classes/logger/syslog.php (1 issue)

Severity
1
<?php
2
class Logger_Syslog {
3
4
    /**
5
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
6
     */
7
    public function log_error($errno, $errstr, $file, $line, $context) {
0 ignored issues
show
The parameter $context is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

7
    public function log_error($errno, $errstr, $file, $line, /** @scrutinizer ignore-unused */ $context) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
8
9
        switch ($errno) {
10
        case E_ERROR:
11
        case E_PARSE:
12
        case E_CORE_ERROR:
13
        case E_COMPILE_ERROR:
14
        case E_USER_ERROR:
15
            $priority = LOG_ERR;
16
            break;
17
        case E_WARNING:
18
        case E_CORE_WARNING:
19
        case E_COMPILE_WARNING:
20
        case E_USER_WARNING:
21
            $priority = LOG_WARNING;
22
            break;
23
        default:
24
            $priority = LOG_INFO;
25
        }
26
27
        $errname = Logger::$errornames[$errno]." ($errno)";
28
29
        syslog($priority, "[tt-rss] $errname ($file:$line) $errstr");
30
31
    }
32
33
}
34