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.

TeamworkObject::areArgumentsValid()   A
last analyzed

Complexity

Conditions 4
Paths 4

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.2
c 0
b 0
f 0
cc 4
eloc 7
nc 4
nop 2
1
<?php
2
3
namespace Ciromattia\Teamwork;
4
5
use Ciromattia\Teamwork\Contracts\RequestableInterface;
6
7
abstract class TeamworkObject
8
{
9
    /**
10
     * @var RequestableInterface
11
     */
12
    protected $client;
13
14
    /**
15
     * @var null|integer
16
     */
17
    protected $id;
18
19
    /**
20
     * @param RequestableInterface $client
21
     * @param null $id
22
     */
23
    public function __construct(RequestableInterface $client, $id = null)
24
    {
25
        $this->client = $client;
26
        $this->id = $id;
27
    }
28
29
    /**
30
     * Get ID
31
     *
32
     * simple getter for ID
33
     *
34
     * @return null
35
     */
36
    public function getID()
37
    {
38
        return $this->id;
39
    }
40
41
    /**
42
     * Are Arguments Valid
43
     *
44
     * @param array $args
45
     * @param string[] $accepted
46
     *
47
     * @return null|bool
48
     */
49
    protected function areArgumentsValid($args, array $accepted)
50
    {
51
        if ($args == null) {
52
            return null;
53
        }
54
55
        foreach ($args as $arg => $value) {
56
            if (!in_array($arg, $accepted)) {
57
                throw new \InvalidArgumentException('This call only accepts these arguments: ' . implode(" | ", $accepted));
58
            }
59
        }
60
61
        return true;
62
    }
63
}