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.

ArgvEncoder::encode()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WyriHaximus\React\ChildProcess\Messenger\ChildProcess;
6
7
use function base64_encode;
8
use function Safe\base64_decode;
9
use function Safe\json_decode;
10
use function Safe\json_encode;
11
12
final class ArgvEncoder
13
{
14
    public static function encode(Options $options): string
15
    {
16
        return base64_encode(json_encode($options->toArray()));
17
    }
18
19
    public static function decode(string $argv): Options
20
    {
21
        return new Options(...json_decode(base64_decode($argv, true)));
0 ignored issues
show
Bug introduced by
The call to WyriHaximus\React\ChildP...\Options::__construct() has too few arguments starting with address. ( Ignorable by Annotation )

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

21
        return /** @scrutinizer ignore-call */ new Options(...json_decode(base64_decode($argv, true)));

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
22
    }
23
}
24