| Conditions | 4 |
| Paths | 3 |
| Total Lines | 9 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function loadAliases() |
||
| 20 | { |
||
| 21 | // `$this->aliases` is declared on each Container's Main Service Provider |
||
| 22 | foreach (isset($this->aliases) ? $this->aliases : [] as $aliasKey => $aliasValue) { |
||
|
|
|||
| 23 | if (class_exists($aliasValue)) { |
||
| 24 | $this->loadAlias($aliasKey, $aliasValue); |
||
| 25 | } |
||
| 26 | } |
||
| 27 | } |
||
| 28 | |||
| 38 |
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: