refactor: susun semula struktur folder — Laravel source ke src/

This commit is contained in:
Saufi
2026-05-19 15:58:35 +08:00
parent f052251b94
commit bf53c71b45
10806 changed files with 1385379 additions and 121 deletions

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace Sabberworm\CSS\Parsing;
/**
* Thrown if the CSS parser encounters a token it did not expect.
*/
class UnexpectedTokenException extends SourceException
{
/**
* @param 'literal'|'identifier'|'count'|'expression'|'search'|'custom' $matchType
* @param int<1, max>|null $lineNumber
*/
public function __construct(string $expected, string $found, string $matchType = 'literal', ?int $lineNumber = null)
{
$message = "Token “{$expected}” ({$matchType}) not found. Got “{$found}”.";
if ($matchType === 'search') {
$message = "Search for “{$expected}” returned no results. Context: “{$found}”.";
} elseif ($matchType === 'count') {
$message = "Next token was expected to have {$expected} chars. Context: “{$found}”.";
} elseif ($matchType === 'identifier') {
$message = "Identifier expected. Got “{$found}";
} elseif ($matchType === 'custom') {
$message = \trim("$expected $found");
}
parent::__construct($message, $lineNumber);
}
}