Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 10 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| ParserErrorException | |
0.00% |
0 / 10 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
2 | |||
| getParserErrorHandler | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace BrianHenryIE\Strauss\Helpers; |
| 4 | |
| 5 | use BrianHenryIE\SimplePhpParser\Parsers\Helper\ParserErrorHandler; |
| 6 | |
| 7 | class ParserErrorException extends \Exception |
| 8 | { |
| 9 | public function __construct(ParserErrorHandler $parserErrorHandler, int $code = 0, \Throwable $previous = null) |
| 10 | { |
| 11 | parent::__construct( |
| 12 | sprintf( |
| 13 | 'Parsing failed with %d errors', |
| 14 | count($parserErrorHandler->getErrors()) |
| 15 | ), |
| 16 | $code, |
| 17 | $previous |
| 18 | ); |
| 19 | |
| 20 | $this->parserErrorHandler = $parserErrorHandler; |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * @return ParserErrorHandler |
| 25 | */ |
| 26 | public function getParserErrorHandler(): ParserErrorHandler |
| 27 | { |
| 28 | return $this->parserErrorHandler; |
| 29 | } |
| 30 | } |