We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 3 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function __construct($reference, Validatable $validator = null, $mandatory = true) |
||
| 21 | { |
||
| 22 | if (!is_string($reference) || empty($reference)) { |
||
| 23 | throw new ComponentException('Invalid attribute/property name'); |
||
| 24 | } |
||
| 25 | |||
| 26 | parent::__construct($reference, $validator, $mandatory); |
||
| 27 | } |
||
| 28 | |||
| 42 |
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: