Completed
Push — master ( 7687bf...0cbb1f )
by Georges
02:21
created
Twig/HumanReadableExtension.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 class HumanReadableExtension extends \Twig_Extension
23 23
 {
24 24
     /**
25
-     * @return array
25
+     * @return \Twig_SimpleFilter[]
26 26
      */
27 27
     public function getFilters()
28 28
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@
 block discarded – undo
41 41
     {
42 42
         $bytes = (int) $bytes;
43 43
         $sz     = 'BKMGTP';
44
-        $factor = floor(( strlen($bytes) - 1 ) / 3);
44
+        $factor = floor((strlen($bytes) - 1) / 3);
45 45
 
46
-        return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)).@$sz[ $factor ].( $factor ? ($octetFormat ? 'O' : 'B') : '' );
46
+        return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$sz[$factor] . ($factor ? ($octetFormat ? 'O' : 'B') : '');
47 47
     }
48 48
 
49 49
     /**
Please login to merge, or discard this patch.
DataCollector/CacheCollector.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -46,26 +46,26 @@
 block discarded – undo
46 46
             }
47 47
             $stats[ $instanceName ] = $cache->getStats();
48 48
             $instances[ $instanceName ] = [
49
-              'driverName' => $cache->getDriverName(),
50
-              'driverConfig' => $cache->getConfig(),
49
+                'driverName' => $cache->getDriverName(),
50
+                'driverConfig' => $cache->getConfig(),
51 51
             ];
52 52
             $driverUsed[ $cache->getDriverName() ] = get_class($cache);
53 53
         }
54 54
 
55 55
         $this->data = [
56
-          'apiVersion' => phpFastCacheApi::getVersion(),
57
-          'apiChangelog' => phpFastCacheApi::getChangelog(),
58
-          'driverUsed' => $driverUsed,
59
-          'instances' => $instances,
60
-          'stats' => $stats,
61
-          'size' => $size,
62
-          'hits' => [
56
+            'apiVersion' => phpFastCacheApi::getVersion(),
57
+            'apiChangelog' => phpFastCacheApi::getChangelog(),
58
+            'driverUsed' => $driverUsed,
59
+            'instances' => $instances,
60
+            'stats' => $stats,
61
+            'size' => $size,
62
+            'hits' => [
63 63
             'read' => (int) CacheManager::$ReadHits,
64 64
             'write' => (int) CacheManager::$WriteHits,
65
-          ],
66
-          'coreConfig' => [
65
+            ],
66
+            'coreConfig' => [
67 67
             'namespacePath' => CacheManager::getNamespacePath()
68
-          ],
68
+            ],
69 69
         ];
70 70
     }
71 71
 
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
             if ($cache->getStats()->getSize()) {
45 45
                 $size += $cache->getStats()->getSize();
46 46
             }
47
-            $stats[ $instanceName ] = $cache->getStats();
48
-            $instances[ $instanceName ] = [
47
+            $stats[$instanceName] = $cache->getStats();
48
+            $instances[$instanceName] = [
49 49
               'driverName' => $cache->getDriverName(),
50 50
               'driverConfig' => $cache->getConfig(),
51 51
             ];
52
-            $driverUsed[ $cache->getDriverName() ] = get_class($cache);
52
+            $driverUsed[$cache->getDriverName()] = get_class($cache);
53 53
         }
54 54
 
55 55
         $this->data = [
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      */
75 75
     public function getStats()
76 76
     {
77
-        return $this->data[ 'stats' ];
77
+        return $this->data['stats'];
78 78
     }
79 79
 
80 80
     /**
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      */
83 83
     public function getInstances()
84 84
     {
85
-        return $this->data[ 'instances' ];
85
+        return $this->data['instances'];
86 86
     }
87 87
 
88 88
     /**
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      */
91 91
     public function getDriverUsed()
92 92
     {
93
-        return $this->data[ 'driverUsed' ];
93
+        return $this->data['driverUsed'];
94 94
     }
95 95
 
96 96
     /**
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      */
99 99
     public function getHits()
100 100
     {
101
-        return $this->data[ 'hits' ];
101
+        return $this->data['hits'];
102 102
     }
103 103
 
104 104
     /**
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
      */
107 107
     public function getSize()
108 108
     {
109
-        return $this->data[ 'size' ];
109
+        return $this->data['size'];
110 110
     }
111 111
 
112 112
     /**
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public function getCoreConfig()
116 116
     {
117
-        return $this->data[ 'coreConfig' ];
117
+        return $this->data['coreConfig'];
118 118
     }
119 119
 
120 120
     /**
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
      */
123 123
     public function getApiVersion()
124 124
     {
125
-        return $this->data[ 'apiVersion' ];
125
+        return $this->data['apiVersion'];
126 126
     }
127 127
 
128 128
     /**
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      */
131 131
     public function getApiChangelog()
132 132
     {
133
-        return $this->data[ 'apiChangelog' ];
133
+        return $this->data['apiChangelog'];
134 134
     }
135 135
 
136 136
     /**
Please login to merge, or discard this patch.
Command/phpFastCacheCommand.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
         $callback = function($name) use ($phpFastCache, $output, &$failedInstances)
51 51
         {
52
-            try{
52
+            try {
53 53
                 if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
54 54
                     $output->writeln("<fg=yellow>Clearing instance {$name} cache...</>");
55 55
                 }
@@ -57,35 +57,35 @@  discard block
 block discarded – undo
57 57
                 if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
58 58
                     $output->writeln("<fg=green>Cache instance {$name} cleared</>");
59 59
                 }
60
-            }catch (phpFastCacheDriverCheckException $e){
60
+            } catch (phpFastCacheDriverCheckException $e) {
61 61
                 $failedInstances[] = $name;
62 62
                 if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
63
-                    $output->writeln("<fg=red>Cache instance {$name} not cleared, got exception: " . "<bg=red;options=bold>" . $e->getMessage() ."</>");
64
-                }else{
63
+                    $output->writeln("<fg=red>Cache instance {$name} not cleared, got exception: " . "<bg=red;options=bold>" . $e->getMessage() . "</>");
64
+                } else {
65 65
                     $output->writeln("<fg=red>Cache instance {$name} not cleared (increase verbosity to get more information).</>");
66 66
                 }
67 67
             }
68 68
         };
69 69
         $caches = $this->getContainer()->getParameter('phpfastcache');
70 70
 
71
-        if($driver) {
72
-            if(array_key_exists($driver, $caches['drivers'])){
71
+        if ($driver) {
72
+            if (array_key_exists($driver, $caches['drivers'])) {
73 73
                 $callback($driver);
74
-                if(!count($failedInstances)){
74
+                if (!count($failedInstances)) {
75 75
                     $io->success("Cache instance {$driver} cleared");
76
-                }else{
76
+                } else {
77 77
                     $io->error("Cache instance {$driver} not cleared");
78 78
                 }
79
-            }else{
79
+            } else {
80 80
                 $io->error("Cache instance {$driver} does not exists");
81 81
             }
82 82
         } else {
83
-            foreach($caches['drivers'] as $name => $parameters) {
83
+            foreach ($caches['drivers'] as $name => $parameters) {
84 84
                 $callback($name);
85 85
             }
86
-            if(!count($failedInstances)){
86
+            if (!count($failedInstances)) {
87 87
                 $io->success('All caches instances got cleared');
88
-            }else{
88
+            } else {
89 89
                 $io->success('Almost all caches instances got cleared, except these: ' . implode(', ', $failedInstances));
90 90
             }
91 91
         }
Please login to merge, or discard this patch.
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
                 if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
58 58
                     $output->writeln("<fg=green>Cache instance {$name} cleared</>");
59 59
                 }
60
-            }catch (phpFastCacheDriverCheckException $e){
60
+            } catch (phpFastCacheDriverCheckException $e){
61 61
                 $failedInstances[] = $name;
62 62
                 if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
63 63
                     $output->writeln("<fg=red>Cache instance {$name} not cleared, got exception: " . "<bg=red;options=bold>" . $e->getMessage() ."</>");
64
-                }else{
64
+                } else{
65 65
                     $output->writeln("<fg=red>Cache instance {$name} not cleared (increase verbosity to get more information).</>");
66 66
                 }
67 67
             }
@@ -73,10 +73,10 @@  discard block
 block discarded – undo
73 73
                 $callback($driver);
74 74
                 if(!count($failedInstances)){
75 75
                     $io->success("Cache instance {$driver} cleared");
76
-                }else{
76
+                } else{
77 77
                     $io->error("Cache instance {$driver} not cleared");
78 78
                 }
79
-            }else{
79
+            } else{
80 80
                 $io->error("Cache instance {$driver} does not exists");
81 81
             }
82 82
         } else {
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             }
86 86
             if(!count($failedInstances)){
87 87
                 $io->success('All caches instances got cleared');
88
-            }else{
88
+            } else{
89 89
                 $io->success('Almost all caches instances got cleared, except these: ' . implode(', ', $failedInstances));
90 90
             }
91 91
         }
Please login to merge, or discard this patch.
DependencyInjection/phpFastCacheExtension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
      */
40 40
     public function load(array $configs, ContainerBuilder $container)
41 41
     {
42
-        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
42
+        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
43 43
         $loader->load('services.yml');
44 44
 
45 45
         $configuration = new Configuration();
Please login to merge, or discard this patch.
Service/Cache.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      */
54 54
     public function __construct($drivers, Stopwatch $stopwatch = null)
55 55
     {
56
-        $this->drivers = (array) $drivers[ 'drivers' ];
56
+        $this->drivers = (array) $drivers['drivers'];
57 57
         $this->stopwatch = $stopwatch;
58 58
     }
59 59
 
@@ -67,10 +67,10 @@  discard block
 block discarded – undo
67 67
      */
68 68
     public function createInstance($name, ExtendedCacheItemPoolInterface $instance)
69 69
     {
70
-        if (array_key_exists($name, $this->cacheInstances) && $this->cacheInstances[ $name ] instanceof ExtendedCacheItemPoolInterface) {
70
+        if (array_key_exists($name, $this->cacheInstances) && $this->cacheInstances[$name] instanceof ExtendedCacheItemPoolInterface) {
71 71
             throw new phpFastCacheDriverException("Cache instance '{$name}' already exists");
72 72
         }
73
-        $this->cacheInstances[ $name ] = $instance;
73
+        $this->cacheInstances[$name] = $instance;
74 74
     }
75 75
 
76 76
     /**
@@ -90,8 +90,8 @@  discard block
 block discarded – undo
90 90
 
91 91
         if (!array_key_exists($name, $this->cacheInstances)) {
92 92
             if (array_key_exists($name, $this->drivers)) {
93
-                $this->createInstance($name, CacheManager::getInstance($this->drivers[ $name ][ 'type' ], $this->drivers[ $name ][ 'parameters' ]));
94
-                if (!$this->cacheInstances[ $name ] instanceof ExtendedCacheItemPoolInterface) {
93
+                $this->createInstance($name, CacheManager::getInstance($this->drivers[$name]['type'], $this->drivers[$name]['parameters']));
94
+                if (!$this->cacheInstances[$name] instanceof ExtendedCacheItemPoolInterface) {
95 95
                     throw new phpFastCacheDriverException("Cache instance '{$name}' does not implements ExtendedCacheItemPoolInterface");
96 96
                 }
97 97
             } else {
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         if ($this->stopwatch) {
103 103
             $this->stopwatch->stop(__METHOD__ . "('{$name}')");
104 104
         }
105
-        return $this->cacheInstances[ $name ];
105
+        return $this->cacheInstances[$name];
106 106
     }
107 107
 
108 108
     /**
Please login to merge, or discard this patch.