| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | public function unsetTrialEndsAtAction(): void |
||
| 17 | { |
||
| 18 | $subscriptions = Subscription::find([ |
||
| 19 | 'conditions' => 'is_deleted = 0 and is_active = 1' |
||
| 20 | ]); |
||
| 21 | |||
| 22 | foreach ($subscriptions as $subscription) { |
||
| 23 | $trialEnds = new Datetime($subscription->trial_ends_at); |
||
| 24 | $trialEnds->setTime(0, 0); |
||
| 25 | $formattedTrialEnds = $trialEnds->format('Y-m-d'); |
||
| 26 | |||
| 27 | if ($formattedTrialEnds == Carbon::today()->toDateString()) { |
||
| 28 | $subscription->trial_ends_at = null; |
||
| 29 | $subscription->updateOrFail(); |
||
| 30 | echo("Company: {$subscription->id} trial has ended, so its trial_ends_at is NULL \n"); |
||
| 31 | } |
||
| 35 |
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