Completed
Push — final ( b2cb52...d7128a )
by Georges
11s
created
tests/AttachingDetachingMethods.test.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -24,17 +24,17 @@  discard block
 block discarded – undo
24 24
 if (!is_object($driverInstance)) {
25 25
     echo '[FAIL] CacheManager::getInstance() returned an invalid variable type:' . gettype($driverInstance) . "\n";
26 26
     $status = 1;
27
-}else if(!($driverInstance instanceof CacheItemPoolInterface)){
27
+} else if (!($driverInstance instanceof CacheItemPoolInterface)) {
28 28
     echo '[FAIL] CacheManager::getInstance() returned an invalid class:' . get_class($driverInstance) . "\n";
29 29
     $status = 1;
30
-}else{
30
+} else {
31 31
     $key = 'test_attaching_detaching';
32 32
 
33 33
     $itemDetached = $driverInstance->getItem($key);
34 34
     $driverInstance->detachItem($itemDetached);
35 35
     $itemAttached = $driverInstance->getItem($key);
36 36
 
37
-    if($driverInstance->isAttached($itemDetached) !== true)
37
+    if ($driverInstance->isAttached($itemDetached) !== true)
38 38
     {
39 39
         echo '[PASS] ExtendedCacheItemPoolInterface::isAttached() identified $itemDetached as being detached.' . "\n";
40 40
     }
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
         $status = 1;
45 45
     }
46 46
 
47
-    try{
47
+    try {
48 48
         $driverInstance->attachItem($itemDetached);
49 49
         echo '[FAIL] ExtendedCacheItemPoolInterface::attachItem() attached $itemDetached without trowing an error.' . "\n";
50 50
         $status = 1;
51
-    }catch(\LogicException $e){
51
+    } catch (\LogicException $e) {
52 52
         echo '[PASS] ExtendedCacheItemPoolInterface::attachItem() failed to attach $itemDetached by trowing a LogicException exception.' . "\n";
53 53
     }
54 54
 
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Devtrue/Driver.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
     protected function driverRead(CacheItemInterface $item)
80 80
     {
81 81
         return [
82
-          self::DRIVER_DATA_WRAPPER_INDEX => true,
83
-          self::DRIVER_TAGS_WRAPPER_INDEX => [],
84
-          self::DRIVER_TIME_WRAPPER_INDEX => new \DateTime(),
82
+            self::DRIVER_DATA_WRAPPER_INDEX => true,
83
+            self::DRIVER_TAGS_WRAPPER_INDEX => [],
84
+            self::DRIVER_TIME_WRAPPER_INDEX => new \DateTime(),
85 85
         ];
86 86
     }
87 87
 
@@ -131,9 +131,9 @@  discard block
 block discarded – undo
131 131
     {
132 132
         $stat = new driverStatistic();
133 133
         $stat->setInfo('[Devtrue] A void info string')
134
-          ->setSize(0)
135
-          ->setData(implode(', ', array_keys($this->itemInstances)))
136
-          ->setRawData(true);
134
+            ->setSize(0)
135
+            ->setData(implode(', ', array_keys($this->itemInstances)))
136
+            ->setRawData(true);
137 137
 
138 138
         return $stat;
139 139
     }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Files/Driver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
             /**
78 78
              * Skip if Existing Caching in Options
79 79
              */
80
-            if (isset($this->config[ 'skipExisting' ]) && $this->config[ 'skipExisting' ] == true && file_exists($file_path)) {
80
+            if (isset($this->config['skipExisting']) && $this->config['skipExisting'] == true && file_exists($file_path)) {
81 81
                 $content = $this->readfile($file_path);
82 82
                 $old = $this->decode($content);
83 83
                 $toWrite = false;
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Devnull/Driver.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
     protected function driverRead(CacheItemInterface $item)
78 78
     {
79 79
         return [
80
-          self::DRIVER_DATA_WRAPPER_INDEX => null,
81
-          self::DRIVER_TAGS_WRAPPER_INDEX => [],
82
-          self::DRIVER_TIME_WRAPPER_INDEX => new \DateTime(),
80
+            self::DRIVER_DATA_WRAPPER_INDEX => null,
81
+            self::DRIVER_TAGS_WRAPPER_INDEX => [],
82
+            self::DRIVER_TIME_WRAPPER_INDEX => new \DateTime(),
83 83
         ];
84 84
     }
85 85
 
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
     {
130 130
         $stat = new driverStatistic();
131 131
         $stat->setInfo('[Devnull] A void info string')
132
-          ->setSize(0)
133
-          ->setData(implode(', ', array_keys($this->itemInstances)))
134
-          ->setRawData(null);
132
+            ->setSize(0)
133
+            ->setData(implode(', ', array_keys($this->itemInstances)))
134
+            ->setRawData(null);
135 135
 
136 136
         return $stat;
137 137
     }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Devfalse/Driver.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
     protected function driverRead(CacheItemInterface $item)
80 80
     {
81 81
         return [
82
-          self::DRIVER_DATA_WRAPPER_INDEX => false,
83
-          self::DRIVER_TAGS_WRAPPER_INDEX => [],
84
-          self::DRIVER_TIME_WRAPPER_INDEX => new \DateTime(),
82
+            self::DRIVER_DATA_WRAPPER_INDEX => false,
83
+            self::DRIVER_TAGS_WRAPPER_INDEX => [],
84
+            self::DRIVER_TIME_WRAPPER_INDEX => new \DateTime(),
85 85
         ];
86 86
     }
87 87
     /**
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
     {
131 131
         $stat = new driverStatistic();
132 132
         $stat->setInfo('[Devfalse] A void info string')
133
-          ->setSize(0)
134
-          ->setData(implode(', ', array_keys($this->itemInstances)))
135
-          ->setRawData(false);
133
+            ->setSize(0)
134
+            ->setData(implode(', ', array_keys($this->itemInstances)))
135
+            ->setRawData(false);
136 136
 
137 137
         return $stat;
138 138
     }
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Mongodb/Driver.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      */
60 60
     public function driverCheck()
61 61
     {
62
-        if(class_exists('MongoDB\Driver\Manager')){
62
+        if (class_exists('MongoDB\Driver\Manager')) {
63 63
             trigger_error('PhpFastCache currently only support the pecl Mongo extension.<br />
64 64
             The Support for the MongoDB extension will be added coming soon.', E_USER_ERROR);
65 65
         }
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
                 return false;
95 95
             }
96 96
 
97
-            return isset($result[ 'ok' ]) ? $result[ 'ok' ] == 1 : true;
97
+            return isset($result['ok']) ? $result['ok'] == 1 : true;
98 98
         } else {
99 99
             throw new \InvalidArgumentException('Cross-Driver type confusion detected');
100 100
         }
@@ -112,9 +112,9 @@  discard block
 block discarded – undo
112 112
 
113 113
         if ($document) {
114 114
             return [
115
-              self::DRIVER_DATA_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_DATA_WRAPPER_INDEX ]->bin),
116
-              self::DRIVER_TIME_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[ self::DRIVER_TIME_WRAPPER_INDEX ]->sec),
117
-              self::DRIVER_TAGS_WRAPPER_INDEX => $this->decode($document[ self::DRIVER_TAGS_WRAPPER_INDEX ]->bin),
115
+              self::DRIVER_DATA_WRAPPER_INDEX => $this->decode($document[self::DRIVER_DATA_WRAPPER_INDEX]->bin),
116
+              self::DRIVER_TIME_WRAPPER_INDEX => (new \DateTime())->setTimestamp($document[self::DRIVER_TIME_WRAPPER_INDEX]->sec),
117
+              self::DRIVER_TAGS_WRAPPER_INDEX => $this->decode($document[self::DRIVER_TAGS_WRAPPER_INDEX]->bin),
118 118
             ];
119 119
         } else {
120 120
             return null;
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         if ($item instanceof Item) {
135 135
             $deletionResult = (array) $this->getCollection()->remove(['_id' => $item->getKey()], ["w" => 1]);
136 136
 
137
-            return (int) $deletionResult[ 'ok' ] === 1 && !$deletionResult[ 'err' ];
137
+            return (int) $deletionResult['ok'] === 1 && !$deletionResult['err'];
138 138
         } else {
139 139
             throw new \InvalidArgumentException('Cross-Driver type confusion detected');
140 140
         }
@@ -158,11 +158,11 @@  discard block
 block discarded – undo
158 158
         if ($this->instance instanceof MongodbClient) {
159 159
             throw new LogicException('Already connected to Mongodb server');
160 160
         } else {
161
-            $host = isset($this->config[ 'host' ]) ? $this->config[ 'host' ] : '127.0.0.1';
162
-            $port = isset($this->config[ 'port' ]) ? $this->config[ 'port' ] : '27017';
163
-            $timeout = isset($this->config[ 'timeout' ]) ? $this->config[ 'timeout' ] : 3;
164
-            $password = isset($this->config[ 'password' ]) ? $this->config[ 'password' ] : '';
165
-            $username = isset($this->config[ 'username' ]) ? $this->config[ 'username' ] : '';
161
+            $host = isset($this->config['host']) ? $this->config['host'] : '127.0.0.1';
162
+            $port = isset($this->config['port']) ? $this->config['port'] : '27017';
163
+            $timeout = isset($this->config['timeout']) ? $this->config['timeout'] : 3;
164
+            $password = isset($this->config['password']) ? $this->config['password'] : '';
165
+            $username = isset($this->config['username']) ? $this->config['username'] : '';
166 166
 
167 167
 
168 168
             /**
@@ -210,8 +210,8 @@  discard block
 block discarded – undo
210 210
         ]);
211 211
 
212 212
         $stats = (new driverStatistic())
213
-          ->setInfo('MongoDB version ' . $serverStatus[ 'version' ] . ', Uptime (in days): ' . round($serverStatus[ 'uptime' ] / 86400, 1) . "\n For more information see RawData.")
214
-          ->setSize((int) @$collStats[ 'size' ])
213
+          ->setInfo('MongoDB version ' . $serverStatus['version'] . ', Uptime (in days): ' . round($serverStatus['uptime'] / 86400, 1) . "\n For more information see RawData.")
214
+          ->setSize((int) @$collStats['size'])
215 215
           ->setData(implode(', ', array_keys($this->itemInstances)))
216 216
           ->setRawData([
217 217
             'serverStatus' => $serverStatus,
Please login to merge, or discard this patch.