DoorAccessAuthorizerStub.php 1.08 KB
Newer Older
1
2
3
4
5
6
<?php


namespace Tests\Doubles;

use Carbon\Carbon;
7
use Source\Entities\Door;
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use Source\Entities\User;
use Source\UseCases\Door\Access\AccessAuthorizer;

class DoorAccessAuthorizerStub implements AccessAuthorizer
{
    public int $checkReturn = self::CONTINUE;

    protected string $doorcode;

    protected ?string $commandString;

    /**
     * @return string
     */
    public function getDoorcode(): string
    {
        return $this->doorcode;
    }

    /**
     * @return string|null
     */
    public function getCommandString(): ?string
    {
        return $this->commandString;
    }

Jacob Priddy's avatar
Jacob Priddy committed
35
36
37
38
39
    public function setReason(string $reason): void
    {
        $this->reason = $reason;
    }

40
41
42
    /**
     * @inheritDoc
     */
43
    public function check(?User $user, Carbon $date, Door $door, string $doorcode, ?string $commandString): int
44
45
46
47
48
    {
        $this->doorcode = $doorcode;
        $this->commandString = $commandString;
        return $this->checkReturn;
    }
Jacob Priddy's avatar
Jacob Priddy committed
49
50
51
52
53
54
55
56

    /**
     * @inheritDoc
     */
    public function getReason(): string
    {
        return 'reason goes here';
    }
57
}