1 | <?php |
||
16 | trait ArgumentsAwareTrait |
||
17 | { |
||
18 | protected $arguments = []; |
||
19 | |||
20 | 13 | public function buildArguments() |
|
27 | |||
28 | 4 | public function addArgument($name, $type, $config = []) |
|
41 | |||
42 | /** |
||
43 | * @param $name |
||
44 | * |
||
45 | * @return InputField |
||
46 | */ |
||
47 | 2 | public function getArgument($name) |
|
51 | |||
52 | /** |
||
53 | * @param $name |
||
54 | * |
||
55 | * @return bool |
||
56 | */ |
||
57 | 2 | public function hasArgument($name) |
|
61 | |||
62 | /** |
||
63 | * @return InputField[] |
||
64 | */ |
||
65 | 7 | public function getArguments() |
|
69 | |||
70 | |||
71 | } |
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: