| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 47 | public function isExpired() :bool |
||
| 48 | { |
||
| 49 | if ($this->expired) { |
||
| 50 | return true; |
||
| 51 | } |
||
| 52 | |||
| 53 | $generatedTime = $this->generated_at->addMinutes($this->validity); |
||
| 54 | |||
| 55 | if (strtotime($generatedTime) >= strtotime(Carbon::now()->toDateTimeString())) { |
||
| 56 | return false; |
||
| 57 | } |
||
| 58 | $this->expired = true; |
||
| 59 | $this->save(); |
||
| 60 | |||
| 61 | return true; |
||
| 62 | } |
||
| 83 | } |