1 | <?php |
||
18 | trait Bindable |
||
19 | { |
||
20 | /** |
||
21 | * The repository alias pattern. |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $repositoryAliasPattern = '{{class}}Contract'; |
||
26 | |||
27 | /** |
||
28 | * Register an IoC binding whether it's already been registered or not. |
||
29 | * |
||
30 | * @param string $abstract |
||
31 | * @param \Closure|string|null $concrete |
||
32 | * @param bool $shared |
||
33 | * @param string|null $alias |
||
34 | * @param bool $force |
||
35 | * |
||
36 | * @return void |
||
37 | */ |
||
38 | protected function bindRepository($abstract, $concrete = null, $shared = true, $alias = null, $force = false) |
||
46 | |||
47 | /** |
||
48 | * Prepare the repository alias. |
||
49 | * |
||
50 | * @param string|null $alias |
||
51 | * @param mixed $concrete |
||
52 | * |
||
53 | * @return string |
||
54 | */ |
||
55 | protected function prepareRepositoryAlias($alias, $concrete) |
||
64 | } |
||
65 |
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: