Skip to content

Commit

Permalink
Remove shorthand ternary operator for compatibility with older PHP ve…
Browse files Browse the repository at this point in the history
…rsions, resolves #23
  • Loading branch information
chiliec committed Mar 17, 2016
1 parent bd0be84 commit bb91c9a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions widgets/Vote.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ public function run()
return $this->render('vote', [
'modelId' => Rating::getModelIdByName($this->model->className()),
'targetId' => $this->model->{$this->model->primaryKey()[0]},
'likes' => $this->model->aggregate->likes ?: 0,
'dislikes' => $this->model->aggregate->dislikes ?: 0,
'rating' => $this->model->aggregate->rating ?: 0.0,
'likes' => isset($this->model->aggregate->likes) ? $this->model->aggregate->likes : 0,
'dislikes' => isset($this->model->aggregate->dislikes) ? $this->model->aggregate->dislikes : 0,
'rating' => isset($this->model->aggregate->rating) ? $this->model->aggregate->rating : 0.0,
'showAggregateRating' => $this->showAggregateRating,
]);
}
Expand Down

0 comments on commit bb91c9a

Please sign in to comment.