Test Setup Failed
Push — master ( dcfdf2...6863da )
by guillaume
16:18 queued 10:15
created

InMemorySocialiteGateway   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 3 1
A user() 0 3 1
1
<?php
2
3
4
namespace App\Src\UseCases\Infra\Gateway\InMemory;
5
6
7
use App\Src\UseCases\Domain\Auth\SocialiteUser;
8
use App\Src\UseCases\Infra\Gateway\Auth\SocialiteGateway;
9
10
class InMemorySocialiteGateway implements SocialiteGateway
11
{
12
    private $users = [];
13
14
    public function user(string $provider): SocialiteUser
15
    {
16
        return $this->users[$provider];
17
    }
18
19
    public function add(SocialiteUser $u, string $provider)
20
    {
21
        $this->users[$provider] = $u;
22
    }
23
24
}
25