| 1 | <?php namespace Rossedman\Teamwork\Traits; |
||
| 3 | trait RestfulTrait { |
||
| 4 | |||
| 5 | /** |
||
| 6 | * @return mixed |
||
| 7 | */ |
||
| 8 | public function all() |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @return mixed |
||
| 15 | */ |
||
| 16 | public function find() |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @return array | companyID |
||
| 23 | */ |
||
| 24 | public function create($data) |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @return mixed |
||
| 31 | */ |
||
| 32 | public function update($data) |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @return mixed |
||
| 39 | */ |
||
| 40 | public function delete() |
||
| 44 | |||
| 45 | |||
| 46 | } |
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: