| 1 | <?php |
||
| 7 | trait Bindable |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * The repository alias pattern. |
||
| 11 | * |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | protected $repositoryAliasPattern = '{{class}}Contract'; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Register an IoC binding whether it's already been registered or not. |
||
| 18 | * |
||
| 19 | * @param string $abstract |
||
| 20 | * @param \Closure|string|null $concrete |
||
| 21 | * @param bool $shared |
||
| 22 | * @param string|null $alias |
||
| 23 | * @param bool $force |
||
| 24 | * |
||
| 25 | * @return void |
||
| 26 | */ |
||
| 27 | protected function bindRepository($abstract, $concrete = null, $shared = true, $alias = null, $force = false): void |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Prepare the repository alias. |
||
| 38 | * |
||
| 39 | * @param string|null $alias |
||
| 40 | * @param mixed $concrete |
||
| 41 | * |
||
| 42 | * @return string |
||
| 43 | */ |
||
| 44 | protected function prepareRepositoryAlias($alias, $concrete): string |
||
| 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: