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

Writeable::parseInstance()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

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.4285
c 0
b 0
f 0
cc 2
eloc 6
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 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