| Conditions | 5 |
| Paths | 3 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | public function updated(Match $model) |
||
| 45 | { |
||
| 46 | $status = array_get($model->getDirty(), 'status'); |
||
| 47 | $resultType = array_get($model->getDirty(), 'resultType'); |
||
| 48 | |||
| 49 | if (Match::RESULT_TYPE_UNKNOWN !== $resultType |
||
| 50 | && Match::STATUS_FINISHED === $status |
||
| 51 | ) { |
||
| 52 | $currentRound = $model->round; |
||
|
|
|||
| 53 | |||
| 54 | $matches = $model->tournament->matches() |
||
| 55 | ->where([ |
||
| 56 | 'round' => $currentRound, 'status' => Match::STATUS_NOT_STARTED |
||
| 57 | ]) |
||
| 58 | ->get(); |
||
| 59 | |||
| 60 | if (Tournament::TYPE_KNOCK_OUT == $model->tournament->type && $matches->count() < 1) { |
||
| 61 | event(new RoundHasBeenFinished($model->tournament)); |
||
| 62 | } |
||
| 63 | } |
||
| 64 | } |
||
| 65 | } |
||
| 66 |
Since your code implements the magic setter
_set, this function will be called for any write access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.