Hash::__construct()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 3
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 7
ccs 4
cts 4
cp 1
crap 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Pgs\HashIdBundle\Annotation;
6
7
/**
8
 * @Annotation
9
 * @Target({"METHOD"})
10
 */
11
class Hash
12
{
13
    private $parameters;
14
15 5
    public function __construct(array $parameters)
16
    {
17 5
        if (isset($parameters['value']) && \is_array($parameters['value'])) {
18 2
            $parameters = $parameters['value'];
19
        }
20
21 5
        $this->parameters = $parameters;
22 5
    }
23
24 5
    public function getParameters(): array
25
    {
26 5
        return $this->parameters;
27
    }
28
}
29