1 | <?php |
||
7 | class WidgetGroupCollection |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * The array of widget groups. |
||
12 | * |
||
13 | * @var array |
||
14 | */ |
||
15 | protected $groups; |
||
16 | |||
17 | /** |
||
18 | * Constructor. |
||
19 | * |
||
20 | * @param ApplicationWrapperContract $app |
||
21 | */ |
||
22 | public function __construct(ApplicationWrapperContract $app) |
||
26 | |||
27 | /** |
||
28 | * Get the widget group object. |
||
29 | * |
||
30 | * @param $name |
||
31 | * |
||
32 | * @return WidgetGroup |
||
33 | */ |
||
34 | public function group($name) |
||
44 | } |
||
45 |
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: