| 1 | <?php namespace GolfLeague\Services; |
||
| 12 | class ScoreService |
||
| 13 | { |
||
| 14 | |||
| 15 | // Containing our matchRepository to make all our database calls |
||
| 16 | protected $matchRepo; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Loads our $matchRepo |
||
| 20 | * |
||
| 21 | * @param MatchRepository $matchRepo |
||
| 22 | * @return MatchService |
||
|
|
|||
| 23 | */ |
||
| 24 | public function __construct(MatchRepository $matchRepo, |
||
| 25 | HoleScoreRepo $holeScoreRepo, |
||
| 26 | Player $player, |
||
| 27 | Match $match, |
||
| 28 | Dispatcher $events) |
||
| 29 | { |
||
| 30 | $this->matchRepo = $matchRepo; |
||
| 31 | $this->holeScoreRepo = $holeScoreRepo; |
||
| 32 | $this->player = $player; |
||
| 33 | $this->match = $match; |
||
| 34 | $this->events = $events; |
||
| 35 | } |
||
| 36 | |||
| 37 | public function update($id, $score) |
||
| 41 | } |
||
| 42 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.