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
Push — master ( 3f218c...4f68bc )
by Carlos Luis
01:55
created

ContextHelper   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 17
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A missingKeys() 0 4 1
A forbiddenKeys() 0 4 1
A removeReservedKeys() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace crojasaragonez\LightService;
6
7
class ContextHelper
8
{
9 24
    public static function missingKeys(array $expected_keys, array $context)
10
    {
11 24
        $diff = array_diff($expected_keys, array_keys($context));
12 24
        return join(array_values($diff), ', ');
0 ignored issues
show
Bug introduced by
', ' of type string is incompatible with the type array expected by parameter $pieces of join(). ( Ignorable by Annotation )

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

12
        return join(array_values($diff), /** @scrutinizer ignore-type */ ', ');
Loading history...
Bug introduced by
array_values($diff) of type array is incompatible with the type string expected by parameter $glue of join(). ( Ignorable by Annotation )

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

12
        return join(/** @scrutinizer ignore-type */ array_values($diff), ', ');
Loading history...
13
    }
14
15 21
    public static function forbiddenKeys(array $forbidden_keys, array $current_keys)
16
    {
17 21
        $diff = array_intersect($forbidden_keys, $current_keys);
18 21
        return join(array_values($diff), ', ');
0 ignored issues
show
Bug introduced by
array_values($diff) of type array is incompatible with the type string expected by parameter $glue of join(). ( Ignorable by Annotation )

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

18
        return join(/** @scrutinizer ignore-type */ array_values($diff), ', ');
Loading history...
Bug introduced by
', ' of type string is incompatible with the type array expected by parameter $pieces of join(). ( Ignorable by Annotation )

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

18
        return join(array_values($diff), /** @scrutinizer ignore-type */ ', ');
Loading history...
19
    }
20
21 18
    public static function removeReservedKeys(array $reserved_keys, array $context)
22
    {
23 18
        return array_diff_key($context, array_flip($reserved_keys));
24
    }
25
}
26