| Conditions | 5 |
| Paths | 12 |
| Total Lines | 27 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | public function handle() |
||
| 41 | { |
||
| 42 | $accounts = Account::where('expire', '<=', date('Y-m-d')) |
||
| 43 | ->where('status', Account::ACCOUNT_ENABLE) |
||
| 44 | ->get(); |
||
| 45 | |||
| 46 | $count = count($accounts); |
||
| 47 | |||
| 48 | $flagCI = $this->option('ci'); |
||
| 49 | if ($flagCI === false) { |
||
| 50 | $bar = $this->output->createProgressBar($count); |
||
| 51 | } |
||
| 52 | |||
| 53 | foreach ($accounts as $account) { |
||
| 54 | $account->disable(); |
||
| 55 | if (isset($bar)) { |
||
| 56 | $bar->advance(); |
||
| 57 | } |
||
| 58 | } |
||
| 59 | |||
| 60 | if (isset($bar)) { |
||
| 61 | $bar->finish(); |
||
| 62 | $this->info("\n"); |
||
| 63 | } |
||
| 64 | |||
| 65 | $this->info("{$count} accounts disabled"); |
||
| 66 | } |
||
| 67 | } |
||
| 68 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.