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.

Logger::writeln()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 3
dl 0
loc 8
rs 10
c 0
b 0
f 0
ccs 3
cts 4
cp 0.75
crap 2.0625
1
<?php
2
3
declare(strict_types=1);
4
5
/* (c) Anton Medvedev <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Deployer\Logger;
12
13
use Deployer\ProcessRunner\Printer;
14
use Deployer\Host\Host;
15
use Deployer\Logger\Handler\HandlerInterface;
16
17
class Logger
18
{
19
    /**
20
     * @var HandlerInterface
21
     */
22 14
    private $handler;
23
24 14
    public function __construct(HandlerInterface $handler)
25 14
    {
26
        $this->handler = $handler;
27 9
    }
28
29 9
    public function log(string $message): void
30 9
    {
31
        $this->handler->log("$message\n");
32
    }
33
34
    public function callback(Host $host): \Closure
35
    {
36
        return function ($type, $buffer) use ($host) {
37
            $this->printBuffer($host, $type, $buffer);
38
        };
39 9
    }
40
41 9
    public function printBuffer(Host $host, string $type, string $buffer): void
42 9
    {
43
        foreach (explode("\n", rtrim($buffer)) as $line) {
44 9
            $this->writeln($host, $type, $line);
45
        }
46 9
    }
47
48 9
    public function writeln(Host $host, string $type, string $line): void
0 ignored issues
show
Unused Code introduced by
The parameter $type 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

48
    public function writeln(Host $host, /** @scrutinizer ignore-unused */ string $type, string $line): void

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...
49
    {
50
        // Omit empty lines
51 9
        if (empty($line)) {
52
            return;
53
        }
54
55 9
        $this->log("[{$host->getAlias()}] $line");
56
    }
57
}
58