| Conditions | 6 |
| Paths | 10 |
| Total Lines | 21 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | public function passes($attribute, $value) |
||
| 25 | { |
||
| 26 | try { |
||
| 27 | $voucher = Vouchers::check($value); |
||
| 28 | |||
| 29 | // Check if the voucher was already redeemed |
||
| 30 | if (auth()->check() && $voucher->users()->wherePivot('user_id', auth()->id())->exists()) { |
||
| 31 | throw VoucherAlreadyRedeemed::create($voucher); |
||
| 32 | } |
||
| 33 | } catch (VoucherIsInvalid $exception) { |
||
| 34 | $this->isInvalid = true; |
||
| 35 | return false; |
||
| 36 | } catch (VoucherExpired $exception) { |
||
| 37 | $this->isExpired = true; |
||
| 38 | return false; |
||
| 39 | } catch (VoucherAlreadyRedeemed $exception) { |
||
| 40 | $this->wasRedeemed = true; |
||
| 41 | return false; |
||
| 42 | } |
||
| 43 | |||
| 44 | return true; |
||
| 45 | } |
||
| 63 |
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