User::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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