awssat /
laravel-visits
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Awssat\Visits\Traits; |
||
| 4 | |||
| 5 | trait Setters |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Return fresh cache from database |
||
| 9 | * @return $this |
||
| 10 | */ |
||
| 11 | public function fresh() |
||
| 12 | { |
||
| 13 | $this->fresh = true; |
||
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 14 | |||
| 15 | return $this; |
||
| 16 | } |
||
| 17 | |||
| 18 | /** |
||
| 19 | * set x seconds for ip expiration |
||
| 20 | * |
||
| 21 | * @param $seconds |
||
| 22 | * @return $this |
||
| 23 | */ |
||
| 24 | public function seconds($seconds) |
||
| 25 | { |
||
| 26 | $this->ipSeconds = $seconds; |
||
|
0 ignored issues
–
show
|
|||
| 27 | |||
| 28 | return $this; |
||
| 29 | } |
||
| 30 | |||
| 31 | |||
| 32 | /** |
||
| 33 | * @param $country |
||
| 34 | * @return $this |
||
| 35 | */ |
||
| 36 | public function country($country) |
||
| 37 | { |
||
| 38 | $this->country = $country; |
||
|
0 ignored issues
–
show
|
|||
| 39 | |||
| 40 | return $this; |
||
| 41 | } |
||
| 42 | |||
| 43 | |||
| 44 | /** |
||
| 45 | * @param $referer |
||
| 46 | * @return $this |
||
| 47 | */ |
||
| 48 | public function referer($referer) |
||
| 49 | { |
||
| 50 | $this->referer = $referer; |
||
|
0 ignored issues
–
show
|
|||
| 51 | |||
| 52 | return $this; |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @param $operatingSystem |
||
| 57 | * @return $this |
||
| 58 | */ |
||
| 59 | public function operatingSystem($operatingSystem) |
||
| 60 | { |
||
| 61 | $this->operatingSystem = $operatingSystem; |
||
|
0 ignored issues
–
show
|
|||
| 62 | |||
| 63 | return $this; |
||
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @param $language |
||
| 68 | * @return $this |
||
| 69 | */ |
||
| 70 | public function language($language) |
||
| 71 | { |
||
| 72 | $this->language = $language; |
||
|
0 ignored issues
–
show
|
|||
| 73 | |||
| 74 | return $this; |
||
| 75 | } |
||
| 76 | |||
| 77 | /** |
||
| 78 | * Change period |
||
| 79 | * |
||
| 80 | * @param $period |
||
| 81 | * @return $this |
||
| 82 | */ |
||
| 83 | public function period($period) |
||
| 84 | { |
||
| 85 | if (in_array($period, $this->periods)) { |
||
| 86 | $this->keys->visits = $this->keys->period($period); |
||
| 87 | } |
||
| 88 | |||
| 89 | return $this; |
||
| 90 | } |
||
| 91 | } |
||
| 92 |