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

State   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
dl 0
loc 22
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A toArray() 0 7 1
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