PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.16
Yatra – Travel Booking & Tour Operator Software v3.0.16
3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 All 84 releases
yatra / vendor / sabberworm / php-css-parser / src / Parsing / UnexpectedTokenException.php

UnexpectedTokenException.php in Yatra – Travel Booking & Tour Operator Software 3.0.16, at vendor/sabberworm/php-css-parser/src/Parsing/UnexpectedTokenException.php

52 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Sabberworm\CSS\Parsing;
4
5 /**
6 * Thrown if the CSS parser encounters a token it did not expect.
7 */
8 class UnexpectedTokenException extends SourceException
9 {
10 /**
11 * @var string
12 */
13 private $sExpected;
14
15 /**
16 * @var string
17 */
18 private $sFound;
19
20 /**
21 * Possible values: literal, identifier, count, expression, search
22 *
23 * @var string
24 */
25 private $sMatchType;
26
27 /**
28 * @param string $sExpected
29 * @param string $sFound
30 * @param string $sMatchType
31 * @param int $iLineNo
32 */
33 public function __construct($sExpected, $sFound, $sMatchType = 'literal', $iLineNo = 0)
34 {
35 $this->sExpected = $sExpected;
36 $this->sFound = $sFound;
37 $this->sMatchType = $sMatchType;
38 $sMessage = "Token “{$sExpected}” ({$sMatchType}) not found. Got “{$sFound}”.";
39 if ($this->sMatchType === 'search') {
40 $sMessage = "Search for “{$sExpected}” returned no results. Context: “{$sFound}”.";
41 } elseif ($this->sMatchType === 'count') {
42 $sMessage = "Next token was expected to have {$sExpected} chars. Context: “{$sFound}”.";
43 } elseif ($this->sMatchType === 'identifier') {
44 $sMessage = "Identifier expected. Got “{$sFound}”";
45 } elseif ($this->sMatchType === 'custom') {
46 $sMessage = trim("$sExpected $sFound");
47 }
48
49 parent::__construct($sMessage, $iLineNo);
50 }
51 }
52