Passed
Push — master ( 1ffd02...b93f0b )
by Bertrand
06:21
created

InMemoryUserRoleRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A all() 0 3 1
A add() 0 3 1
1
<?php
2
3
4
namespace App\Src\UseCases\Infra\InMemory;
5
6
7
use App\Src\UseCases\Domain\Ports\UserRoleRepository;
8
use App\Src\UseCases\Domain\Users\Dto\Role;
9
use Illuminate\Support\Collection;
10
11
class InMemoryUserRoleRepository implements UserRoleRepository
12
{
13
    private $roles;
14
15
    public function add(Role $role)
16
    {
17
        $this->roles[] = $role;
18
    }
19
20
    public function all(): Collection
21
    {
22
        return collect($this->roles);
23
    }
24
25
}
26