friendship ended with social-app. php is my new best friend
1<?php
2declare(strict_types=1);
3
4namespace Lcobucci\JWT;
5
6use DateTimeInterface;
7use Lcobucci\JWT\Token\DataSet;
8
9interface Token
10{
11 /**
12 * Returns the token headers
13 */
14 public function headers(): DataSet;
15
16 /**
17 * Returns if the token is allowed to be used by the audience
18 *
19 * @param non-empty-string $audience
20 */
21 public function isPermittedFor(string $audience): bool;
22
23 /**
24 * Returns if the token has the given id
25 *
26 * @param non-empty-string $id
27 */
28 public function isIdentifiedBy(string $id): bool;
29
30 /**
31 * Returns if the token has the given subject
32 *
33 * @param non-empty-string $subject
34 */
35 public function isRelatedTo(string $subject): bool;
36
37 /**
38 * Returns if the token was issued by any of given issuers
39 *
40 * @param non-empty-string ...$issuers
41 */
42 public function hasBeenIssuedBy(string ...$issuers): bool;
43
44 /**
45 * Returns if the token was issued before of given time
46 */
47 public function hasBeenIssuedBefore(DateTimeInterface $now): bool;
48
49 /**
50 * Returns if the token minimum time is before than given time
51 */
52 public function isMinimumTimeBefore(DateTimeInterface $now): bool;
53
54 /**
55 * Returns if the token is expired
56 */
57 public function isExpired(DateTimeInterface $now): bool;
58
59 /**
60 * Returns an encoded representation of the token
61 *
62 * @return non-empty-string
63 */
64 public function toString(): string;
65}