File: UnsupportedParser.php

package info (click to toggle)
php-lcobucci-jwt 5.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,304 kB
  • sloc: php: 6,674; makefile: 49
file content (62 lines) | stat: -rw-r--r-- 1,474 bytes parent folder | download | duplicates (2)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
declare(strict_types=1);

namespace Lcobucci\JWT\Tests;

use DateTimeInterface;
use Lcobucci\JWT\Parser;
use Lcobucci\JWT\Token;
use Lcobucci\JWT\Token\DataSet;

final class UnsupportedParser implements Parser
{
    public function parse(string $jwt): Token
    {
        return new class () implements Token {
            public function headers(): DataSet
            {
                return new DataSet([], '');
            }

            public function isPermittedFor(string $audience): bool
            {
                return false;
            }

            public function isIdentifiedBy(string $id): bool
            {
                return false;
            }

            public function isRelatedTo(string $subject): bool
            {
                return false;
            }

            public function hasBeenIssuedBy(string ...$issuers): bool
            {
                return false;
            }

            public function hasBeenIssuedBefore(DateTimeInterface $now): bool
            {
                return false;
            }

            public function isMinimumTimeBefore(DateTimeInterface $now): bool
            {
                return false;
            }

            public function isExpired(DateTimeInterface $now): bool
            {
                return false;
            }

            public function toString(): string
            {
                return 'unsupported-parser';
            }
        };
    }
}