Test Setup Failed
Push — master ( 6863da...811519 )
by guillaume
27:05 queued 21:33
created

State::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
nc 1
nop 4
dl 0
loc 6
rs 10
c 1
b 0
f 0
1
<?php
2
3
4
namespace App\Src\UseCases\Domain\Users;
5
6
7
class State
8
{
9
    private $organizationId;
10
    private $state;
11
    private $lastLoginAt;
12
    private $roles;
13
14
    public function __construct(?string $organizationId, ?string $lastLoginAt, bool $state = false, array $roles = [])
15
    {
16
        $this->organizationId = $organizationId;
17
        $this->state = $state;
18
        $this->lastLoginAt = $lastLoginAt;
19
        $this->roles = $roles;
20
    }
21
22
    public function toArray()
23
    {
24
        return [
25
            'organization_id' => $this->organizationId,
26
            'roles' => $this->roles,
27
            'state' => $this->state,
28
            'last_login_at' => $this->lastLoginAt
29
        ];
30
    }
31
}
32