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.
Completed
Pull Request — master (#21)
by Cees-Jan
09:11
created

File::update()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
ccs 0
cts 0
cp 0
cc 1
eloc 5
nc 1
nop 2
crap 2
1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Client\Github\Resource\Async\Contents;
4
5
use ApiClients\Client\Github\CommandBus\Command\RefreshCommand;
6
use ApiClients\Client\Github\Resource\Contents\File as BaseFile;
7
use React\Promise\CancellablePromiseInterface;
8
use React\Stream\ReadableStreamInterface;
9
use React\Stream\ThroughStream;
10
11
class File extends BaseFile
12
{
13
    public function refresh(): CancellablePromiseInterface
14
    {
15
        return $this->handleCommand(new RefreshCommand($this));
16
    }
17
18
    public function update(
19
        ReadableStreamInterface $contents,
0 ignored issues
show
Unused Code introduced by
The parameter $contents is not used and could be removed.

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

Loading history...
20
        string $message = null
0 ignored issues
show
Unused Code introduced by
The parameter $message is not used and could be removed.

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

Loading history...
21
    ): CancellablePromiseInterface {
22
        $bodyStream = new ThroughStream();
0 ignored issues
show
Unused Code introduced by
$bodyStream is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
23
    }
24
}
25