generated from Nodarx/template
feat: initial version
Signed-off-by: Sebastian Krupinski <root@LAPTOP-7DVOR6NC>
This commit was merged in pull request #1.
This commit is contained in:
24
lib/Client/Protocol/Response/Parser/ParseError.php
Normal file
24
lib/Client/Protocol/Response/Parser/ParseError.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Gricob\IMAP\Protocol\Response\Parser;
|
||||
|
||||
final class ParseError extends \Exception
|
||||
{
|
||||
/**
|
||||
* @param TokenType[] $expected
|
||||
*/
|
||||
public static function unexpectedToken(?TokenType $given, array $expected, string $input): self
|
||||
{
|
||||
return new self(
|
||||
sprintf(
|
||||
"Expected token of type %s. Given %s.\n%s",
|
||||
implode(
|
||||
' or ',
|
||||
array_map(fn (TokenType $type) => $type->name, $expected)
|
||||
),
|
||||
$given?->name ?? 'null',
|
||||
$input
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user