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.

Parameter   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 61
rs 10
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A remove() 0 9 2
A set() 0 5 1
A toArray() 0 3 1
A instance() 0 3 1
1
<?php
2
3
namespace Soheilrt\AdobeConnectClient\Client;
4
5
use Soheilrt\AdobeConnectClient\Client\Contracts\ArrayableInterface;
6
use Soheilrt\AdobeConnectClient\Client\Helpers\StringCaseTransform as SCT;
7
use Soheilrt\AdobeConnectClient\Client\Helpers\ValueTransform as VT;
8
9
/**
10
 * A generic Parameter class to extra parameters.
11
 */
12
class Parameter implements ArrayableInterface
13
{
14
    /**
15
     * @var array
16
     */
17
    protected $parameters = [];
18
19
    /**
20
     * Returns a new Parameter instance.
21
     *
22
     * @return Parameter
23
     */
24
    public static function instance(): Parameter
25
    {
26
        return new static();
27
    }
28
29
    /**
30
     * Add a parameter.
31
     *
32
     * @param string $parameter
33
     * @param mixed  $value
34
     *
35
     * @return Parameter Fluent Interface
36
     */
37
    public function set($parameter, $value): Parameter
38
    {
39
        $this->parameters[SCT::toHyphen($parameter)] = VT::toString($value);
40
41
        return $this;
42
    }
43
44
    /**
45
     * Remove a parameter.
46
     *
47
     * @param string $parameter
48
     *
49
     * @return Parameter Fluent Interface
50
     */
51
    public function remove($parameter): Parameter
52
    {
53
        $parameter = SCT::toHyphen($parameter);
54
55
        if (isset($this->parameters[$parameter])) {
56
            unset($this->parameters[$parameter]);
57
        }
58
59
        return $this;
60
    }
61
62
    /**
63
     * Retrieves all not null attributes in an associative array.
64
     *
65
     * The keys in hash style: Ex: is-member
66
     * The values as string
67
     *
68
     * @return string[]
69
     */
70
    public function toArray(): array
71
    {
72
        return $this->parameters;
73
    }
74
}
75