Completed
Push — master ( 2e5350...f0c5b4 )
by Tobias
10:07
created

ClassReadOnly::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 8
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 8
loc 8
rs 9.4285
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
namespace Happyr\SerializerBundle\Tests\Fixtures\ReadOnly;
4
5
use Happyr\SerializerBundle\Annotation as Serializer;
6
7
/**
8
 * @Serializer\ReadOnly()
9
 */
10
class ClassReadOnly
11
{
12
    /**
13
     * @Serializer\ReadOnly(false)
14
     */
15
    private $model;
16
17
    private $size;
18
19
    /**
20
     * @Serializer\ReadOnly()
21
     */
22
    private $color;
23
24
    public function __construct($withValues = false)
25
    {
26
        if ($withValues) {
27
            $this->model = 'val_model';
28
            $this->size = 'val_size';
29
            $this->color = 'val_color';
30
        }
31
    }
32
}
33