AccessAuthorizer.php 668 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php


namespace Source\UseCases\Door\Access;

use Carbon\Carbon;
use Source\Entities\User;

interface AccessAuthorizer
{
    public const ALLOW = 0;
    public const DENY = 1;
    public const CONTINUE = 2;

    /**
     * Must return an access authorizer status
     *
     * @param \Source\Entities\User|null $user
     * @param \Carbon\Carbon             $date
     * @param string                     $doorId
     * @param string                     $doorcode
     * @param string                     $commandString
     * @return int
     */
    public function check(?User $user, Carbon $date, string $doorId, string $doorcode, ?string $commandString): int;
}