| 1 | <?php |
||
| 9 | trait hasCompetitorsTrait |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * get Fighter by Id. |
||
| 13 | * |
||
| 14 | * @param $competitorId |
||
| 15 | * |
||
| 16 | * @return Competitor |
||
| 17 | */ |
||
| 18 | protected function getFighter($competitorId) |
||
| 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 | } |
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: