1 | <?php |
||
8 | class PassInvalidException extends \RuntimeException |
||
9 | { |
||
10 | /** |
||
11 | * Construct a PassInvalidException either with or without an array of errors. |
||
12 | * |
||
13 | * @param string[]|null $errors |
||
14 | */ |
||
15 | public function __construct(array $errors = null) |
||
19 | |||
20 | /** |
||
21 | * Returns the errors with the pass. |
||
22 | * |
||
23 | * @return string[] |
||
24 | */ |
||
25 | public function getErrors() |
||
29 | } |
||
30 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: