Completed
Push — master ( c0c41c...fc0657 )
by Freek
01:13
created

User::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 2
1
<?php
2
3
namespace OhDear\PhpSdk\Resources;
4
5
class User extends ApiResource
6
{
7
    /** @var int */
8
    public $id;
9
10
    /** @var string */
11
    public $name;
12
13
    /** @var string */
14
    public $email;
15
16
    /** @var email */
17
    public $photoUrl;
18
19
    /** @var Team[]  */
20
    public $teams;
21
22
    public function __construct(array $attributes, $ohDear = null)
23
    {
24
        parent::__construct($attributes, $ohDear);
25
26
        $this->teams = array_map(function (array $teamAttributes) {
27
            return new Team($teamAttributes);
28
        }, $this->teams);
29
    }
30
}
31