wp-user-avatar
/
third-party
/
vendor
/
sabberworm
/
php-css-parser
/
src
/
Parsing
/
SourceException.php
wp-user-avatar
/
third-party
/
vendor
/
sabberworm
/
php-css-parser
/
src
/
Parsing
Last commit date
Anchor.php
5 days ago
OutputException.php
5 days ago
ParserState.php
5 days ago
SourceException.php
5 days ago
UnexpectedEOFException.php
5 days ago
UnexpectedTokenException.php
5 days ago
SourceException.php
23 lines
| 1 | <?php |
| 2 | |
| 3 | declare (strict_types=1); |
| 4 | namespace ProfilePressVendor\Sabberworm\CSS\Parsing; |
| 5 | |
| 6 | use ProfilePressVendor\Sabberworm\CSS\Position\Position; |
| 7 | use ProfilePressVendor\Sabberworm\CSS\Position\Positionable; |
| 8 | class SourceException extends \Exception implements Positionable |
| 9 | { |
| 10 | use Position; |
| 11 | /** |
| 12 | * @param int<1, max>|null $lineNumber |
| 13 | */ |
| 14 | public function __construct(string $message, ?int $lineNumber = null) |
| 15 | { |
| 16 | $this->setPosition($lineNumber); |
| 17 | if ($lineNumber !== null) { |
| 18 | $message .= " [line no: {$lineNumber}]"; |
| 19 | } |
| 20 | parent::__construct($message); |
| 21 | } |
| 22 | } |
| 23 |