Total Complexity | 7 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | trait CanBeRated |
||
6 | { |
||
7 | /** |
||
8 | * Relationship for models that rated this model. |
||
9 | * |
||
10 | * @param Model $model The model types of the results. |
||
11 | * @return morphToMany The relationship. |
||
|
|||
12 | */ |
||
13 | public function raters($model = null) |
||
14 | { |
||
15 | return $this->morphToMany(($model) ?: $this->getMorphClass(), 'rateable', 'ratings', 'rateable_id', 'rater_id') |
||
16 | ->withPivot('rater_type', 'rating') |
||
17 | ->wherePivot('rater_type', ($model) ?: $this->getMorphClass()) |
||
18 | ->wherePivot('rateable_type', $this->getMorphClass()); |
||
19 | } |
||
20 | |||
21 | /** |
||
22 | * Calculate the average rating of the current model. |
||
23 | * |
||
24 | * @return float The average rating. |
||
25 | */ |
||
26 | public function averageRating($model = null): float |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * Count the ratings of the current model. |
||
37 | * |
||
38 | * @return int The ratings count. |
||
39 | */ |
||
40 | public function countRatings($model = null): int |
||
49 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths