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 (#41)
by Casper
01:20
created

Command   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
c 2
b 0
f 0
lcom 1
cbo 1
dl 0
loc 25
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A options() 0 6 1
A optionsWithArguments() 0 8 2
A removeEqualSigns() 0 6 1
1
<?php
2
3
namespace Spatie\PhpUnitWatcher\PhpUnit;
4
5
use PHPUnit\TextUI\Command as PhpUnitCommand;
6
7
class Command extends PhpUnitCommand
8
{
9
    public static function options()
10
    {
11
        $options = array_keys((new static)->longOptions);
12
13
        return self::removeEqualSigns($options);
14
    }
15
16
    public static function optionsWithArguments()
17
    {
18
        $options = array_keys((new static)->longOptions);
19
20
        return self::removeEqualSigns(array_filter($options, function ($option) {
21
            return substr($option, -1) === '=' && substr($option, -2) !== '==';
22
        }));
23
    }
24
25
    protected static function removeEqualSigns($options)
26
    {
27
        return array_map(function ($option) {
28
            return str_replace('=', '', $option);
29
        }, $options);
30
    }
31
}
32