| 1 | <?php |
||
| 9 | class InvalidDirectory extends Exception |
||
| 10 | { |
||
| 11 | private const CODE = 4002; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @var null|string |
||
| 15 | */ |
||
| 16 | protected $directory; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @param string $directory Directory |
||
| 20 | * @param ExceptionContract $previous Previous Exception if nested exception |
||
|
|
|||
| 21 | * |
||
| 22 | * @return ExceptionContract |
||
| 23 | */ |
||
| 24 | public static function forDirectory(string $directory, ExceptionContract $previous = null): ExceptionContract |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @return null|string |
||
| 35 | */ |
||
| 36 | final public function getDirectory(): ?string |
||
| 40 | } |
||
| 41 |
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.