@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | ->connect($config['connection']) |
76 | 76 | ->setPrefix($config['keys_prefix'] ?? $config['redis_keys_prefix'] ?? 'visits'); |
77 | 77 | |
78 | - if(! $this->connection) { |
|
78 | + if (!$this->connection) { |
|
79 | 79 | return; |
80 | 80 | } |
81 | 81 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | 'eloquent' => \Awssat\Visits\DataEngines\EloquentEngine::class |
98 | 98 | ]; |
99 | 99 | |
100 | - if(! array_key_exists($name, $connections)) { |
|
100 | + if (!array_key_exists($name, $connections)) { |
|
101 | 101 | throw new \Exception("(Laravel-Visits) The selected engine `{$name}` is not supported! Please correct this issue from config/visits.php."); |
102 | 102 | } |
103 | 103 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | */ |
111 | 111 | public function by($subject) |
112 | 112 | { |
113 | - if($subject instanceof Model) { |
|
113 | + if ($subject instanceof Model) { |
|
114 | 114 | $this->keys->append($this->keys->modelName($subject), $subject->{$subject->getKeyName()}); |
115 | 115 | } else if (is_array($subject)) { |
116 | 116 | $this->keys->append(array_keys($subject)[0], Arr::first($subject)); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public function recordedIp() |
139 | 139 | { |
140 | - if(! $this->connection->exists($this->keys->ip(request()->ip()))) { |
|
140 | + if (!$this->connection->exists($this->keys->ip(request()->ip()))) { |
|
141 | 141 | $this->connection->set($this->keys->ip(request()->ip()), true); |
142 | 142 | $this->connection->setExpiration($this->keys->ip(request()->ip()), $this->ipSeconds); |
143 | 143 | |
@@ -154,13 +154,13 @@ discard block |
||
154 | 154 | public function count() |
155 | 155 | { |
156 | 156 | if ($this->country) { |
157 | - return $this->connection->get($this->keys->visits."_countries:{$this->keys->id}", $this->country); |
|
157 | + return $this->connection->get($this->keys->visits . "_countries:{$this->keys->id}", $this->country); |
|
158 | 158 | } else if ($this->referer) { |
159 | - return $this->connection->get($this->keys->visits."_referers:{$this->keys->id}", $this->referer); |
|
159 | + return $this->connection->get($this->keys->visits . "_referers:{$this->keys->id}", $this->referer); |
|
160 | 160 | } else if ($this->operatingSystem) { |
161 | - return $this->connection->get($this->keys->visits."_OSes:{$this->keys->id}", $this->operatingSystem); |
|
161 | + return $this->connection->get($this->keys->visits . "_OSes:{$this->keys->id}", $this->operatingSystem); |
|
162 | 162 | } else if ($this->language) { |
163 | - return $this->connection->get($this->keys->visits."_languages:{$this->keys->id}", $this->language); |
|
163 | + return $this->connection->get($this->keys->visits . "_languages:{$this->keys->id}", $this->language); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | return intval( |
@@ -203,14 +203,14 @@ discard block |
||
203 | 203 | $this->connection->increment($this->keys->visits, $inc, $this->keys->id); |
204 | 204 | $this->connection->increment($this->keys->visitsTotal(), $inc); |
205 | 205 | |
206 | - if(is_array($this->globalIgnore) && sizeof($this->globalIgnore) > 0) { |
|
206 | + if (is_array($this->globalIgnore) && sizeof($this->globalIgnore) > 0) { |
|
207 | 207 | $ignore = array_merge($ignore, $this->globalIgnore); |
208 | 208 | } |
209 | 209 | |
210 | 210 | //NOTE: $$method is parameter also .. ($periods,$country,$refer) |
211 | 211 | foreach (['country', 'refer', 'periods', 'operatingSystem', 'language'] as $method) { |
212 | - if(! in_array($method, $ignore)) { |
|
213 | - $this->{'record'.Str::studly($method)}($inc); |
|
212 | + if (!in_array($method, $ignore)) { |
|
213 | + $this->{'record' . Str::studly($method)}($inc); |
|
214 | 214 | } |
215 | 215 | } |
216 | 216 |