| Conditions | 3 |
| Paths | 2 |
| Total Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | protected function prepareRepositoryAlias($alias, $concrete): string |
||
| 45 | { |
||
| 46 | if (! $alias && ! $concrete instanceof \Closure) { |
||
| 47 | $concrete = str_replace('Repositories', 'Contracts', $concrete); |
||
| 48 | $alias = str_replace('{{class}}', $concrete, $this->repositoryAliasPattern); |
||
| 49 | } |
||
| 50 | |||
| 51 | return $alias; |
||
| 52 | } |
||
| 53 | } |
||
| 54 |
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: