Passed
Pull Request — master (#28)
by
unknown
03:37
created
src/Traits/Record.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Visits.php 1 patch
Spacing   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.