Model::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
eloc 2
rs 10
nc 1
nop 2
cc 1
1
<?php
2
3
namespace MathieuTu\Exporter\Tests\Fixtures;
4
5
use MathieuTu\Exporter\Exporter;
6
7
class Model
8
{
9
    use Exporter;
10
11
    private $attributes;
12
13
    private $otherProperty;
14
15
    public function __construct(array $attributes, $otherProperty = null)
16
    {
17
        $this->attributes = $attributes;
18
        $this->otherProperty = $otherProperty;
19
    }
20
21
    public function test($value): string
22
    {
23
        return 'test' . $value;
24
    }
25
26
    public function __get($name)
27
    {
28
        return $this->attributes[$name];
29
    }
30
31
    public function __isset($name): bool
32
    {
33
        return isset($this->attributes[$name]);
34
    }
35
36
    public function getOtherProperty()
37
    {
38
        return $this->otherProperty;
39
    }
40
}
41