OutputException.php
3 years ago
ParserState.php
3 years ago
SourceException.php
3 years ago
UnexpectedEOFException.php
3 years ago
UnexpectedTokenException.php
3 years ago
SourceException.php
31 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP\Sabberworm\CSS\Parsing; |
| 4 | |
| 5 | class SourceException extends \Exception |
| 6 | { |
| 7 | /** |
| 8 | * @var int |
| 9 | */ |
| 10 | private $iLineNo; |
| 11 | /** |
| 12 | * @param string $sMessage |
| 13 | * @param int $iLineNo |
| 14 | */ |
| 15 | public function __construct($sMessage, $iLineNo = 0) |
| 16 | { |
| 17 | $this->iLineNo = $iLineNo; |
| 18 | if (!empty($iLineNo)) { |
| 19 | $sMessage .= " [line no: {$iLineNo}]"; |
| 20 | } |
| 21 | parent::__construct($sMessage); |
| 22 | } |
| 23 | /** |
| 24 | * @return int |
| 25 | */ |
| 26 | public function getLineNo() |
| 27 | { |
| 28 | return $this->iLineNo; |
| 29 | } |
| 30 | } |
| 31 |