| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3.0416 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function passes($attribute, $value): bool |
||
| 33 | 30 | { |
|
| 34 | 24 | $this->attribute = $attribute; |
|
| 35 | |||
| 36 | if (! $user = Auth::guard($this->guard)->user()) { |
||
| 37 | 6 | return false; |
|
| 38 | } |
||
| 39 | |||
| 40 | if (! $model = app($this->className)->resolveRouteBinding($value)) { |
||
| 41 | 6 | return false; |
|
| 42 | } |
||
| 43 | |||
| 44 | 6 | return $user->can($this->ability, $model); |
|
| 45 | } |
||
| 46 | 6 | ||
| 58 |