| 1 | <?php |
||
| 21 | trait FetchRoleTrait |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * Collection of all tags. |
||
| 25 | * |
||
| 26 | * @var Collection |
||
| 27 | */ |
||
| 28 | protected $roles = null; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @var RoleRepository |
||
| 32 | */ |
||
| 33 | protected $roleRepository; |
||
| 34 | |||
| 35 | public function setRoleRepository(RoleRepository $roleRepository) |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @return TagRepository |
||
| 44 | */ |
||
| 45 | public function getRoleRepository() |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @return Collection |
||
| 56 | */ |
||
| 57 | protected function getRoleNameDropdown() |
||
| 61 | } |
||
| 62 |
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: