| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | protected function newExpiration($period) |
||
| 35 | { |
||
| 36 | try { |
||
| 37 | $periodCarbon = $this->xHoursPeriod($period) ?? Carbon::now()->{'endOf' . Str::studly($period)}(); |
||
| 38 | } catch (Exception $e) { |
||
| 39 | throw new Exception("Wrong period: `{$period}`! please update config/visits.php file."); |
||
| 40 | } |
||
| 41 | |||
| 42 | return $periodCarbon->diffInSeconds() + 1; |
||
| 43 | } |
||
| 57 |