| Conditions | 5 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 41 | public function __toString() : string |
||
| 42 | { |
||
| 43 | $symbol = ''; |
||
| 44 | $input = $this->getInputStream(); |
||
| 45 | |||
| 46 | if (!$input instanceof CharStream) { |
||
| 47 | throw new \RuntimeException('Unexpected stream type.'); |
||
| 48 | } |
||
| 49 | |||
| 50 | if ($input !== null && $this->startIndex >= 0 && $this->startIndex < $input->getLength()) { |
||
| 51 | $symbol = $input->getText($this->startIndex, $this->startIndex); |
||
| 52 | $symbol = StringUtils::escapeWhitespace($symbol, false); |
||
| 53 | } |
||
| 54 | |||
| 55 | return \sprintf('%s(\'%s\')', self::class, $symbol); |
||
| 56 | } |
||
| 58 |