Passed
Pull Request — master (#3)
by
unknown
09:00
created
src/Middleware/QueryCacher.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
         $stopTime = microtime(true);
62 62
         $computeTime = (int) ($stopTime - $startTime);
63 63
         $recomputed = $cacheItem->set(DTO\Cache\ResultWrapper::wrap($result, $computeTime, $query->getTTL()))
64
-          ->expiresAfter($query->getTTL());
64
+            ->expiresAfter($query->getTTL());
65 65
 
66 66
         $this->cachePool->save($recomputed);
67 67
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
         /** @var Interfaces\Result $result */
60 60
         $result = $next($query);
61 61
         $stopTime = microtime(true);
62
-        $computeTime = (int) ($stopTime - $startTime);
62
+        $computeTime = (int)($stopTime - $startTime);
63 63
         $recomputed = $cacheItem->set(DTO\Cache\ResultWrapper::wrap($result, $computeTime, $query->getTTL()))
64 64
           ->expiresAfter($query->getTTL());
65 65
 
Please login to merge, or discard this patch.
src/DTO/Cache/ResultWrapper.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             'recomputeSeconds' => $this->recomputeSeconds,
43 43
             'ttl' => $this->ttl,
44 44
             'storedTimestamp' => $this->getTimeStamp(),
45
-         ]);
45
+            ]);
46 46
     }
47 47
 
48 48
     /**
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     public function willProbablyExpireSoon(): bool
69 69
     {
70 70
         return ($this->getTimeStamp() - $this->recomputeSeconds * 1 * log(mt_rand() / mt_getrandmax())
71
-          > $this->expiresAfterTimestamp());
71
+            > $this->expiresAfterTimestamp());
72 72
     }
73 73
 
74 74
     private function expiresAfterTimestamp(): int
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,6 +73,6 @@
 block discarded – undo
73 73
 
74 74
     private function expiresAfterTimestamp(): int
75 75
     {
76
-        return (int) (($this->storedTimestamp ?? $this->getTimeStamp()) + $this->ttl);
76
+        return (int)(($this->storedTimestamp ?? $this->getTimeStamp()) + $this->ttl);
77 77
     }
78 78
 }
Please login to merge, or discard this patch.
src/Middleware/PerfBudgetLogger.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,14 +34,14 @@
 block discarded – undo
34 34
         $startTime = microtime(true);
35 35
         $startMemoryBytes = memory_get_usage(true);
36 36
         $result = $next($query);
37
-        $totalTime = (float) microtime(true) - $startTime;
37
+        $totalTime = (float)microtime(true) - $startTime;
38 38
         $totalMegabytesIncrease = (memory_get_peak_usage(true) - $startMemoryBytes) / 1000000;
39 39
 
40 40
         if ($this->isOverThresholds($totalTime, $totalMegabytesIncrease)) {
41 41
             $this->getLogger()->log(
42
-                (string) $this->logLevel,
42
+                (string)$this->logLevel,
43 43
                 'Performance threshold exceeded',
44
-                ['MB' => $totalMegabytesIncrease, 'seconds' => $totalTime, 'query' => get_class($query) ]
44
+                ['MB' => $totalMegabytesIncrease, 'seconds' => $totalTime, 'query' => get_class($query)]
45 45
             );
46 46
         }
47 47
 
Please login to merge, or discard this patch.
src/Middleware/QueryLogger.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
     public function __invoke(object $query, callable $next): Interfaces\Result
16 16
     {
17 17
         if ($query instanceof Interfaces\LoggableQuery) {
18
-            $this->getLogger()->log((string) $query->getLogLevel(), $query->getLogMessage(), $query->getLogContext());
18
+            $this->getLogger()->log((string)$query->getLogLevel(), $query->getLogMessage(), $query->getLogContext());
19 19
         }
20 20
 
21 21
         return $next($query);
Please login to merge, or discard this patch.
src/QueryBus.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     {
31 31
         $next = $this->callStack;
32 32
 
33
-        $this->callStack = function (object $query) use ($middleware, $next): Interfaces\Result {
33
+        $this->callStack = function(object $query) use ($middleware, $next): Interfaces\Result {
34 34
             return $middleware($query, $next);
35 35
         };
36 36
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
     private function seedCallStack(): callable
46 46
     {
47
-        return function (object $query): Interfaces\Result {
47
+        return function(object $query): Interfaces\Result {
48 48
             return $this->resolver->resolve($query)->handle($query, $this);
49 49
         };
50 50
     }
Please login to merge, or discard this patch.