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.

JobUtils   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 2
dl 0
loc 32
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A configureJobNamesArgument() 0 4 1
A getJobNames() 0 10 2
A isWildcard() 0 4 2
1
<?php
2
/**
3
 * @package: chapi
4
 *
5
 * @author:  msiebeneicher
6
 * @since:   2015-09-02
7
 */
8
9
namespace Chapi\Component\Command;
10
11
use Symfony\Component\Console\Command\Command;
12
use Symfony\Component\Console\Input\InputArgument;
13
use Symfony\Component\Console\Input\InputInterface;
14
15
class JobUtils implements JobUtilsInterface
16
{
17
    /**
18
     * @inheritdoc
19
     */
20 8
    public static function configureJobNamesArgument(Command $command, $description)
21
    {
22 8
        $command->addArgument(self::ARGUMENT_JOBNAMES, InputArgument::IS_ARRAY, $description);
23 8
    }
24
25
    /**
26
     * @inheritdoc
27
     */
28 9
    public static function getJobNames(InputInterface $input, Command $command)
29
    {
30 9
        $jobNames = $input->getArgument(self::ARGUMENT_JOBNAMES);
31
32 9
        if (empty($jobNames)) {
33 1
            throw new \InvalidArgumentException(sprintf('Nothing specified, nothing %sed. Maybe you wanted to say "%s ."?', $command->getName(), $command->getName()));
34
        }
35
36 8
        return $jobNames;
37
    }
38
39
    /**
40
     * @inheritdoc
41
     */
42 8
    public static function isWildcard(array $jobNames)
43
    {
44 8
        return (isset($jobNames[0]) && in_array($jobNames[0], ['.', '*']));
45
    }
46
}
47