@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | protected function recordCountry($inc) |
| 13 | 13 | { |
| 14 | - $this->redis->zincrby($this->keys->visits."_countries:{$this->keys->id}", $inc, $this->getVisitorCountry()); |
|
| 14 | + $this->redis->zincrby($this->keys->visits . "_countries:{$this->keys->id}", $inc, $this->getVisitorCountry()); |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | /** |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | protected function recordRefer($inc) |
| 21 | 21 | { |
| 22 | - $this->redis->zincrby($this->keys->visits."_referers:{$this->keys->id}", $inc, $this->getVisitorReferer()); |
|
| 22 | + $this->redis->zincrby($this->keys->visits . "_referers:{$this->keys->id}", $inc, $this->getVisitorReferer()); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | protected function recordOperatingSystem($inc) |
| 29 | 29 | { |
| 30 | - $this->redis->zincrby($this->keys->visits."_OSes:{$this->keys->id}", $inc, $this->getVisitorOperatingSystem()); |
|
| 30 | + $this->redis->zincrby($this->keys->visits . "_OSes:{$this->keys->id}", $inc, $this->getVisitorOperatingSystem()); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /** |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | protected function recordLanguage($inc) |
| 37 | 37 | { |
| 38 | - $this->redis->zincrby($this->keys->visits."_languages:{$this->keys->id}", $inc, $this->getVisitorLanguage()); |
|
| 38 | + $this->redis->zincrby($this->keys->visits . "_languages:{$this->keys->id}", $inc, $this->getVisitorLanguage()); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $periodKey = $this->keys->period($period); |
| 48 | 48 | |
| 49 | 49 | $this->redis->zincrby($periodKey, $inc, $this->keys->id); |
| 50 | - $this->redis->incrby($periodKey.'_total', $inc); |
|
| 50 | + $this->redis->incrby($periodKey . '_total', $inc); |
|
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | public function by($subject) |
| 94 | 94 | { |
| 95 | - if($subject instanceof Model) { |
|
| 95 | + if ($subject instanceof Model) { |
|
| 96 | 96 | $this->keys->append($this->keys->modelName($subject), $subject->{$subject->getKeyName()}); |
| 97 | 97 | } else if (is_array($subject)) { |
| 98 | 98 | $this->keys->append(array_keys($subject)[0], Arr::first($subject)); |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | public function recordedIp() |
| 123 | 123 | { |
| 124 | - return ! $this->redis->set($this->keys->ip(request()->ip()), true, 'EX', $this->ipSeconds, 'NX'); |
|
| 124 | + return !$this->redis->set($this->keys->ip(request()->ip()), true, 'EX', $this->ipSeconds, 'NX'); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /** |
@@ -144,8 +144,7 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | return intval( |
| 146 | 146 | $this->keys->instanceOfModel ? |
| 147 | - $this->redis->zscore($this->keys->visits, $this->keys->id) : |
|
| 148 | - $this->redis->get($this->keys->visitsTotal()) |
|
| 147 | + $this->redis->zscore($this->keys->visits, $this->keys->id) : $this->redis->get($this->keys->visitsTotal()) |
|
| 149 | 148 | ); |
| 150 | 149 | } |
| 151 | 150 | |
@@ -186,14 +185,14 @@ discard block |
||
| 186 | 185 | $this->redis->zincrby($this->keys->visits, $inc, $this->keys->id); |
| 187 | 186 | $this->redis->incrby($this->keys->visitsTotal(), $inc); |
| 188 | 187 | |
| 189 | - if(is_array($this->globalIgnore) && sizeof($this->globalIgnore) > 0) { |
|
| 188 | + if (is_array($this->globalIgnore) && sizeof($this->globalIgnore) > 0) { |
|
| 190 | 189 | $ignore = array_merge($ignore, $this->globalIgnore); |
| 191 | 190 | } |
| 192 | 191 | |
| 193 | 192 | //NOTE: $$method is parameter also .. ($periods,$country,$refer) |
| 194 | 193 | foreach (['country', 'refer', 'periods', 'operatingSystem', 'language'] as $method) { |
| 195 | - if(! in_array($method, $ignore)) { |
|
| 196 | - $this->{'record'.Str::studly($method)}($inc); |
|
| 194 | + if (!in_array($method, $ignore)) { |
|
| 195 | + $this->{'record' . Str::studly($method)}($inc); |
|
| 197 | 196 | } |
| 198 | 197 | } |
| 199 | 198 | } |