diff options
| author | polo <ordipolo@gmx.fr> | 2024-08-13 23:45:21 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2024-08-13 23:45:21 +0200 |
| commit | bf6655a534a6775d30cafa67bd801276bda1d98d (patch) | |
| tree | c6381e3f6c81c33eab72508f410b165ba05f7e9c /vendor/doctrine/lexer/src/Token.php | |
| parent | 94d67a4b51f8e62e7d518cce26a526ae1ec48278 (diff) | |
| download | AppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.tar.gz AppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.tar.bz2 AppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.zip | |
VERSION 0.2 doctrine ORM et entités
Diffstat (limited to 'vendor/doctrine/lexer/src/Token.php')
| -rw-r--r-- | vendor/doctrine/lexer/src/Token.php | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/vendor/doctrine/lexer/src/Token.php b/vendor/doctrine/lexer/src/Token.php new file mode 100644 index 0000000..b6df694 --- /dev/null +++ b/vendor/doctrine/lexer/src/Token.php | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Common\Lexer; | ||
| 6 | |||
| 7 | use UnitEnum; | ||
| 8 | |||
| 9 | use function in_array; | ||
| 10 | |||
| 11 | /** | ||
| 12 | * @template T of UnitEnum|string|int | ||
| 13 | * @template V of string|int | ||
| 14 | */ | ||
| 15 | final class Token | ||
| 16 | { | ||
| 17 | /** | ||
| 18 | * The string value of the token in the input string | ||
| 19 | * | ||
| 20 | * @readonly | ||
| 21 | * @var V | ||
| 22 | */ | ||
| 23 | public string|int $value; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * The type of the token (identifier, numeric, string, input parameter, none) | ||
| 27 | * | ||
| 28 | * @readonly | ||
| 29 | * @var T|null | ||
| 30 | */ | ||
| 31 | public $type; | ||
| 32 | |||
| 33 | /** | ||
| 34 | * The position of the token in the input string | ||
| 35 | * | ||
| 36 | * @readonly | ||
| 37 | */ | ||
| 38 | public int $position; | ||
| 39 | |||
| 40 | /** | ||
| 41 | * @param V $value | ||
| 42 | * @param T|null $type | ||
| 43 | */ | ||
| 44 | public function __construct(string|int $value, $type, int $position) | ||
| 45 | { | ||
| 46 | $this->value = $value; | ||
| 47 | $this->type = $type; | ||
| 48 | $this->position = $position; | ||
| 49 | } | ||
| 50 | |||
| 51 | /** @param T ...$types */ | ||
| 52 | public function isA(...$types): bool | ||
| 53 | { | ||
| 54 | return in_array($this->type, $types, true); | ||
| 55 | } | ||
| 56 | } | ||
