Skip to content

Commit d581cef

Browse files
committed
Move methods to base token
1 parent 7ba88a6 commit d581cef

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

src/Connection/Tokens/Atom.php

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,4 @@
55
/**
66
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-atom
77
*/
8-
class Atom extends Token
9-
{
10-
/**
11-
* Determine if the token is the given value.
12-
*/
13-
public function is(string $value): bool
14-
{
15-
return $this->value === $value;
16-
}
17-
18-
/**
19-
* Determine if the token is not the given value.
20-
*/
21-
public function isNot(string $value): bool
22-
{
23-
return ! $this->is($value);
24-
}
25-
}
8+
class Atom extends Token {}

src/Connection/Tokens/Token.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,22 @@ public function __construct(
1313
public string $value,
1414
) {}
1515

16+
/**
17+
* Determine if the token is the given value.
18+
*/
19+
public function is(string $value): bool
20+
{
21+
return $this->value === $value;
22+
}
23+
24+
/**
25+
* Determine if the token is not the given value.
26+
*/
27+
public function isNot(string $value): bool
28+
{
29+
return ! $this->is($value);
30+
}
31+
1632
/**
1733
* Get the token's value.
1834
*/

0 commit comments

Comments
 (0)