Completed
Push — standalone ( 1b0272...9e8eb1 )
by Philip
04:15
created

Writeable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A parseInstance() 0 11 2
1
<?php
2
3
namespace Dontdrinkandroot\RestBundle\Metadata\Annotation;
4
5
/**
6
 * @author Philip Washington Sorst <[email protected]>
7
 */
8
abstract class Writeable
9
{
10
    /**
11
     * @var \Dontdrinkandroot\RestBundle\Metadata\Annotation\Right
12
     */
13
    public $right;
14
15
    /**
16
     * @var bool
17
     */
18
    public $byReference;
19
20 48
    protected static function parseInstance($config, $instance)
21
    {
22 48
        if (null === $config) {
23 48
            return null;
24
        }
25
26 30
        $instance->right = Right::parse($config['right'] ?? null);
27 30
        $instance->byReference = ParseUtils::parseBool($config['byReference'] ?? null);
28
29 30
        return $instance;
30
    }
31
}
32