| @@ 67-77 (lines=11) @@ | ||
| 64 | $this->tokenType = $type; |
|
| 65 | } |
|
| 66 | ||
| 67 | public function endsWith($needle) |
|
| 68 | { |
|
| 69 | $length = strlen($needle); |
|
| 70 | if ($length == 0) { |
|
| 71 | return true; |
|
| 72 | } |
|
| 73 | ||
| 74 | $start = $length * -1; |
|
| 75 | ||
| 76 | return (substr($this->token, $start) === $needle); |
|
| 77 | } |
|
| 78 | ||
| 79 | public function isWhitespaceToken() |
|
| 80 | { |
|
| @@ 68-78 (lines=11) @@ | ||
| 65 | * @param string $haystack |
|
| 66 | * @param string $needle |
|
| 67 | */ |
|
| 68 | protected function endsWith($haystack, $needle) |
|
| 69 | { |
|
| 70 | $length = strlen($needle); |
|
| 71 | if ($length == 0) { |
|
| 72 | return true; |
|
| 73 | } |
|
| 74 | ||
| 75 | $start = $length * -1; |
|
| 76 | ||
| 77 | return (substr($haystack, $start) === $needle); |
|
| 78 | } |
|
| 79 | ||
| 80 | /** |
|
| 81 | * Revokes the escaping characters from an expression. |
|