Completed
Push — master ( c47c6a...b116a1 )
by Arnold
03:00
created

NoConfirmation::withLogger()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Jasny\Auth\Confirmation;
6
7
use Jasny\Auth\StorageInterface as Storage;
8
use Jasny\Auth\UserInterface as User;
9
use Psr\Log\LoggerInterface as Logger;
10
11
/**
12
 * No support for confirmation tokens.
13
 */
14
class NoConfirmation implements ConfirmationInterface
15
{
16
    /**
17
     * @inheritDoc
18
     */
19 1
    public function withStorage(Storage $storage)
20
    {
21 1
        return $this;
22
    }
23
24
    /**
25
     * @inheritDoc
26
     */
27 1
    public function withLogger(Logger $logger)
28
    {
29 1
        return $this;
30
    }
31
32
    /**
33
     * @inheritDoc
34
     */
35 1
    public function withSubject(string $subject)
36
    {
37 1
        return $this;
38
    }
39
40
    /**
41
     * Generate a confirmation token.
42
     *
43
     * @throws \LogicException
44
     */
45 1
    public function getToken(User $user, \DateTimeInterface $expire): string
46
    {
47 1
        throw new \LogicException("Confirmation tokens are not supported");
48
    }
49
50
    /**
51
     * Get user by confirmation token.
52
     *
53
     * @param string $token Confirmation token
54
     * @return User
55
     * @throws \LogicException
56
     */
57 1
    public function from(string $token): User
58
    {
59 1
        throw new \LogicException("Confirmation tokens are not supported");
60
    }
61
}
62