We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 3 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | public function deleteExpiredTokens($expireTime) |
||
| 29 | { |
||
| 30 | $query = $this->createQuery(); |
||
| 31 | |||
| 32 | $constraints = []; |
||
| 33 | |||
| 34 | $constraints[] = $query->lessThan('tstamp', (int) (time() - $expireTime)); |
||
| 35 | |||
| 36 | if (count($constraints)) { |
||
| 37 | $query->matching($query->logicalAnd($constraints)); |
||
| 38 | } |
||
| 39 | |||
| 40 | $tokensToBeRemoved = $query->execute(); |
||
| 41 | |||
| 42 | foreach($tokensToBeRemoved as $token) { |
||
| 43 | $this->remove($token); |
||
| 44 | } |
||
| 47 |