| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | public function actionRemoveOldUnconfirmedAccounts(): void |
||
| 21 | { |
||
| 22 | $this->stdout("Removing accounts older than {$this->ageThreshold} days...\n", Console::FG_YELLOW); |
||
| 23 | $count = User::deleteAll([ |
||
| 24 | 'and', |
||
| 25 | ['or', |
||
| 26 | ['not', ['verify_email_token' => null]], |
||
| 27 | // we have to escape the '_' at the start of User::CONFIRMED_STRING |
||
| 28 | ['not like', 'verify_email_token', '%\\'.User::CONFIRMED_STRING, false] |
||
| 29 | ], |
||
| 30 | ['<', 'created_at', $this->getTimeThreshold()], |
||
| 31 | ]); |
||
| 32 | |||
| 33 | $this->stdout("Removed $count accounts", Console::FG_GREEN); |
||
| 34 | } |
||
| 48 |