Right   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A parse() 0 12 2
1
<?php
2
3
namespace Dontdrinkandroot\RestBundle\Metadata\Annotation;
4
5
use Doctrine\Common\Annotations\Annotation\Required;
6
7
/**
8
 * @Annotation
9
 * @Target({"ANNOTATION"})
10
 *
11
 * @author Philip Washington Sorst <[email protected]>
12
 */
13
class Right
14
{
15
    /**
16
     * @Required
17
     * @var array<string>
18
     */
19
    public $attributes;
20
21
    /**
22
     * @var string
23
     */
24
    public $propertyPath;
25
26 54
    public static function parse(?array $config): ?Right
27
    {
28 54
        if (null === $config) {
29 54
            return null;
30
        }
31
32 52
        $right = new Right();
33 52
        $right->attributes = ParseUtils::parseStringArray($config['attributes'] ?? null);
34 52
        $right->propertyPath = ParseUtils::parseString($config['propertyPath'] ?? null);
35
36 52
        return $right;
37
    }
38
}
39