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 ( 857a5b...3bbd23 )
by Cees-Jan
06:33
created

AbstractResource   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 21
ccs 0
cts 14
cp 0
rs 10
wmc 4
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setExtraProperties() 0 6 2
A setPropertyValue() 0 9 2
1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Foundation\Resource;
4
5
use ApiClients\Foundation\Hydrator\HydrateTrait;
6
7
abstract class AbstractResource implements ResourceInterface
8
{
9
    use HydrateTrait;
10
11
    public function setExtraProperties(array $properties)
12
    {
13
        foreach ($properties as $key => $value) {
14
            $this->setPropertyValue($key, $value);
15
        }
16
    }
17
18
    private function setPropertyValue(string $key, $value)
19
    {
20
        $methodName = $key . 'Setter';
21
        if (!method_exists($this, $methodName)) {
22
            return;
23
        }
24
25
        $this->$methodName($value);
26
    }
27
}
28