mirror of
https://github.com/standardebooks/web.git
synced 2025-07-12 09:32:24 -04:00
Add Composer autoloading functions and PHPStan for testing
This commit is contained in:
parent
e198c4db65
commit
f5d7d4e02a
1518 changed files with 169063 additions and 30 deletions
69
vendor/phpstan/phpdoc-parser/src/Parser/ParserException.php
vendored
Normal file
69
vendor/phpstan/phpdoc-parser/src/Parser/ParserException.php
vendored
Normal file
|
@ -0,0 +1,69 @@
|
|||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Parser;
|
||||
|
||||
use PHPStan\PhpDocParser\Lexer\Lexer;
|
||||
|
||||
class ParserException extends \Exception
|
||||
{
|
||||
|
||||
/** @var string */
|
||||
private $currentTokenValue;
|
||||
|
||||
/** @var int */
|
||||
private $currentTokenType;
|
||||
|
||||
/** @var int */
|
||||
private $currentOffset;
|
||||
|
||||
/** @var int */
|
||||
private $expectedTokenType;
|
||||
|
||||
public function __construct(
|
||||
string $currentTokenValue,
|
||||
int $currentTokenType,
|
||||
int $currentOffset,
|
||||
int $expectedTokenType
|
||||
)
|
||||
{
|
||||
$this->currentTokenValue = $currentTokenValue;
|
||||
$this->currentTokenType = $currentTokenType;
|
||||
$this->currentOffset = $currentOffset;
|
||||
$this->expectedTokenType = $expectedTokenType;
|
||||
|
||||
$json = json_encode($currentTokenValue, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
||||
assert($json !== false);
|
||||
|
||||
parent::__construct(sprintf(
|
||||
'Unexpected token %s, expected %s at offset %d',
|
||||
$json,
|
||||
Lexer::TOKEN_LABELS[$expectedTokenType],
|
||||
$currentOffset
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
public function getCurrentTokenValue(): string
|
||||
{
|
||||
return $this->currentTokenValue;
|
||||
}
|
||||
|
||||
|
||||
public function getCurrentTokenType(): int
|
||||
{
|
||||
return $this->currentTokenType;
|
||||
}
|
||||
|
||||
|
||||
public function getCurrentOffset(): int
|
||||
{
|
||||
return $this->currentOffset;
|
||||
}
|
||||
|
||||
|
||||
public function getExpectedTokenType(): int
|
||||
{
|
||||
return $this->expectedTokenType;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue