| 1 | <?php |
||
| 9 | final class ParsingFailed extends Exception |
||
| 10 | { |
||
| 11 | private const CODE = 1004; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @var null|string |
||
| 15 | */ |
||
| 16 | private $failedFile; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @param string $file |
||
| 20 | * @param ExceptionContract $previous |
||
|
|
|||
| 21 | * |
||
| 22 | * @return ExceptionContract |
||
| 23 | */ |
||
| 24 | public static function forFile(string $file, ExceptionContract $previous = null): ExceptionContract |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Get the file which parsing failed for. |
||
| 35 | * |
||
| 36 | * @return null|string |
||
| 37 | */ |
||
| 38 | public function getFailedFile(): ?string |
||
| 42 | } |
||
| 43 |
This check looks for
@paramannotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.