Writeable::parseInstance()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 6
cts 6
cp 1
rs 9.9
c 0
b 0
f 0
cc 2
nc 2
nop 2
crap 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 54
    protected static function parseInstance($config, $instance)
21
    {
22 54
        if (null === $config) {
23 54
            return null;
24
        }
25
26 34
        $instance->right = Right::parse($config['right'] ?? null);
27 34
        $instance->byReference = ParseUtils::parseBool($config['byReference'] ?? null);
28
29 34
        return $instance;
30
    }
31
}
32