Passed
Pull Request — master (#223)
by
unknown
02:29
created
config/laravel-model-caching.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,6 +10,6 @@
 block discarded – undo
10 10
     'enable-cooldown' => env('MODEL_CACHE_COOLDOWN_ENABLE', true),
11 11
 
12 12
     'cooldown-disable' => [
13
-		//put full qualified classnames here
13
+        //put full qualified classnames here
14 14
     ]
15 15
 ];
Please login to merge, or discard this patch.
src/Traits/DisableCooldown.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,5 +2,5 @@
 block discarded – undo
2 2
 
3 3
 trait DisableCooldown
4 4
 {
5
-	//
5
+    //
6 6
 }
7 7
\ No newline at end of file
Please login to merge, or discard this patch.
src/Traits/Caching.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         $modelClassName = get_class($instance);
99 99
 
100 100
         if( $this->cooldownDisabled($modelClassName) ){
101
-        	return [null, null, null];
101
+            return [null, null, null];
102 102
         }
103 103
 
104 104
         [$cacheCooldown, $invalidatedAt, $savedAt] = $this
@@ -179,32 +179,32 @@  discard block
 block discarded – undo
179 179
 
180 180
     public function cooldownDisabled(string $class) : bool
181 181
     {
182
-    	return ! config('laravel-model-caching.enable-cooldown', true)
183
-		    || in_array($class, config('laravel-model-caching.cooldown-disable', []))
184
-		    || $this->getAllTraitsUsedByClass($class)
185
-		            ->contains('GeneaLabs\LaravelModelCaching\Traits\DisableCooldown');
182
+        return ! config('laravel-model-caching.enable-cooldown', true)
183
+            || in_array($class, config('laravel-model-caching.cooldown-disable', []))
184
+            || $this->getAllTraitsUsedByClass($class)
185
+                    ->contains('GeneaLabs\LaravelModelCaching\Traits\DisableCooldown');
186 186
     }
187 187
 
188
-	/** @SuppressWarnings(PHPMD.BooleanArgumentFlag) */
189
-	public static function getAllTraitsUsedByClass(
190
-		string $classname,
191
-		bool $autoload = true
192
-	) : Collection {
193
-		$traits = collect();
188
+    /** @SuppressWarnings(PHPMD.BooleanArgumentFlag) */
189
+    public static function getAllTraitsUsedByClass(
190
+        string $classname,
191
+        bool $autoload = true
192
+    ) : Collection {
193
+        $traits = collect();
194 194
 
195
-		if (class_exists($classname, $autoload)) {
196
-			$traits = collect(class_uses($classname, $autoload));
197
-		}
195
+        if (class_exists($classname, $autoload)) {
196
+            $traits = collect(class_uses($classname, $autoload));
197
+        }
198 198
 
199
-		$parentClass = get_parent_class($classname);
199
+        $parentClass = get_parent_class($classname);
200 200
 
201
-		if ($parentClass) {
202
-			$traits = $traits
203
-				->merge(static::getAllTraitsUsedByClass($parentClass, $autoload));
204
-		}
201
+        if ($parentClass) {
202
+            $traits = $traits
203
+                ->merge(static::getAllTraitsUsedByClass($parentClass, $autoload));
204
+        }
205 205
 
206
-		return $traits;
207
-	}
206
+        return $traits;
207
+    }
208 208
 
209 209
     protected function setCacheCooldownSavedAtTimestamp(Model $instance)
210 210
     {
Please login to merge, or discard this patch.