1 | <?php |
||
9 | trait hasTeamsTrait |
||
10 | { |
||
11 | /** |
||
12 | * get Fighter by Id. |
||
13 | * |
||
14 | * @param $teamId |
||
15 | * |
||
16 | * @return Team |
||
17 | */ |
||
18 | protected function getFighter($teamId) |
||
22 | |||
23 | /** |
||
24 | * Fighter is the name for competitor or team, depending on the case. |
||
25 | * |
||
26 | * @return Collection |
||
27 | */ |
||
28 | protected function getFighters() |
||
32 | |||
33 | protected function createByeFighter() |
||
37 | |||
38 | |||
39 | } |
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: