Completed
Push — master ( 33476c...427ebd )
by Bertrand
09:14
created

AnonymousUser::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
4
namespace App\Src\UseCases\Domain\Agricultural\Model;
5
6
7
use App\Src\UseCases\Domain\Ports\InteractionRepository;
8
9
class AnonymousUser implements CanInteract
10
{
11
    use Interact;
12
13
    private $identifier;
14
    private $interactionRepository;
15
16
    public function __construct(string $identifier)
17
    {
18
        $this->identifier = $identifier;
19
        $this->interactionRepository = app(InteractionRepository::class);
20
    }
21
22
    public function key(): string
23
    {
24
        return 'cookie_user_session_id';
25
    }
26
27
    public function identifier():string
28
    {
29
        return $this->identifier;
30
    }
31
32
    public function transfer(RegisteredUser $registeredUser)
33
    {
34
        $this->interactionRepository->transfer($this, $registeredUser);
35
    }
36
}
37