Total Complexity | 7 |
Total Lines | 59 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php namespace GeneaLabs\LaravelCaffeine; |
||
5 | class Dripper extends Model |
||
6 | { |
||
7 | public function getHtmlAttribute() : string |
||
8 | { |
||
9 | $html = (string) view('genealabs-laravel-caffeine::script') |
||
10 | ->with([ |
||
11 | 'ageCheckInterval' => $this->ageCheckInterval, |
||
1 ignored issue
–
show
|
|||
12 | 'ageThreshold' => $this->ageThreshold, |
||
1 ignored issue
–
show
|
|||
13 | 'interval' => $this->interval, |
||
1 ignored issue
–
show
|
|||
14 | 'url' => $this->url, |
||
1 ignored issue
–
show
|
|||
15 | ]); |
||
16 | return $html; |
||
17 | } |
||
18 | |||
19 | public function getAgeCheckIntervalAttribute() : int |
||
20 | { |
||
21 | return config( |
||
22 | 'genealabs-laravel-caffeine.outdatedDripCheckInterval', |
||
23 | 2000 |
||
24 | ); |
||
25 | } |
||
26 | |||
27 | public function getAgeThresholdAttribute() : int |
||
28 | { |
||
29 | return (config('session.lifetime', 32) - 2) * 60000; |
||
30 | } |
||
31 | |||
32 | public function getIntervalAttribute() : string |
||
33 | { |
||
34 | return config( |
||
35 | 'genealabs-laravel-caffeine.dripInterval', |
||
36 | 300000 |
||
37 | ); |
||
38 | } |
||
39 | |||
40 | public function getThresholdAttribute() : int |
||
41 | { |
||
42 | return config( |
||
43 | 'genealabs-laravel-caffeine.thresholdDifference', |
||
44 | 10000 |
||
45 | ); |
||
46 | } |
||
47 | |||
48 | public function getCheckIntervalAttribute() : int |
||
53 | ); |
||
54 | } |
||
55 | |||
56 | public function getUrlAttribute() : string |
||
57 | { |
||
64 | } |
||
65 | } |
||
66 |