1 | <?php |
||
7 | class ActivityService |
||
8 | { |
||
9 | public function __construct(Activity $model) |
||
13 | |||
14 | /** |
||
15 | * All activities |
||
16 | * |
||
17 | * @return Collection |
||
18 | */ |
||
19 | public function getByUser($userId, $paginate = null) |
||
29 | |||
30 | /** |
||
31 | * Create an activity record |
||
32 | * |
||
33 | * @param string $description |
||
34 | * @return Activity |
||
35 | */ |
||
36 | public function log($description = '') |
||
55 | } |
||
56 |
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: