Completed
Push — V6 ( 8b729c...5d3acf )
by Georges
03:16
created
src/phpFastCache/CacheManager.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -64,95 +64,95 @@  discard block
 block discarded – undo
64 64
         /**
65 65
          * Specify if the item must provide detailed creation/modification dates
66 66
          */
67
-      'itemDetailedDate' => false,
67
+        'itemDetailedDate' => false,
68 68
 
69 69
         /**
70 70
          * Automatically attempt to fallback to temporary directory
71 71
          * if the cache fails to write on the specified directory
72 72
          */
73
-      'autoTmpFallback' => false,
73
+        'autoTmpFallback' => false,
74 74
 
75 75
         /**
76 76
          * Provide a secure file manipulation mechanism,
77 77
          * on intensive usage the performance can be affected.
78 78
          */
79
-      'secureFileManipulation' => false,
79
+        'secureFileManipulation' => false,
80 80
 
81 81
         /**
82 82
          * Ignore Symfony notice for Symfony project which
83 83
          * do not makes use of PhpFastCache's Symfony Bundle
84 84
          */
85
-      'ignoreSymfonyNotice' => false,
85
+        'ignoreSymfonyNotice' => false,
86 86
 
87 87
         /**
88 88
          * Default time-to-live in second
89 89
          */
90
-      'defaultTtl' => 900,
90
+        'defaultTtl' => 900,
91 91
 
92 92
         /**
93 93
          * Default key hash function
94 94
          * (md5 by default)
95 95
          */
96
-      'defaultKeyHashFunction' => '',
96
+        'defaultKeyHashFunction' => '',
97 97
 
98 98
         /**
99 99
          * The securityKey that will be used
100 100
          * to create sub-directory
101 101
          * (Files-based drivers only)
102 102
          */
103
-      'securityKey' => 'auto',
103
+        'securityKey' => 'auto',
104 104
 
105 105
         /**
106 106
          * Auto-generate .htaccess if it's missing
107 107
          * (Files-based drivers only)
108 108
          */
109
-      'htaccess' => true,
109
+        'htaccess' => true,
110 110
 
111 111
         /**
112 112
          * Default files chmod
113 113
          * 0777 recommended
114 114
          * (Files-based drivers only)
115 115
          */
116
-      'default_chmod' => 0777,
116
+        'default_chmod' => 0777,
117 117
 
118 118
         /**
119 119
          * The path where we will writecache files
120 120
          * default value if empty: sys_get_temp_dir()
121 121
          * (Files-based drivers only)
122 122
          */
123
-      'path' => '',
123
+        'path' => '',
124 124
 
125 125
         /**
126 126
          * Driver fallback in case of failure.
127 127
          * Caution, in case of failure an E_WARNING
128 128
          * error will always be raised
129 129
          */
130
-      'fallback' => false,
130
+        'fallback' => false,
131 131
 
132 132
         /**
133 133
          * Maximum size (bytes) of object store in memory
134 134
          * (Memcache(d) drivers only)
135 135
          */
136
-      'limited_memory_each_object' => 4096,
136
+        'limited_memory_each_object' => 4096,
137 137
 
138 138
         /**
139 139
          * Compress stored data, if the backend supports it
140 140
          * (Memcache(d) drivers only)
141 141
          */
142
-      'compress_data' => false,
142
+        'compress_data' => false,
143 143
 
144 144
         /**
145 145
          * Prevent cache slams when
146 146
          * making use of heavy cache
147 147
          * items
148 148
          */
149
-      'preventCacheSlams' => false,
149
+        'preventCacheSlams' => false,
150 150
 
151 151
         /**
152 152
          * Cache slams timeout
153 153
          * in seconds
154 154
          */
155
-      'cacheSlamsTimeout' => 15,
155
+        'cacheSlamsTimeout' => 15,
156 156
 
157 157
     ];
158 158
 
@@ -335,24 +335,24 @@  discard block
 block discarded – undo
335 335
     public static function getStaticSystemDrivers()
336 336
     {
337 337
         return [
338
-          'Apc',
339
-          'Apcu',
340
-          'Cassandra',
341
-          'Couchbase',
342
-          'Couchdb',
343
-          'Devnull',
344
-          'Files',
345
-          'Leveldb',
346
-          'Memcache',
347
-          'Memcached',
348
-          'Memstatic',
349
-          'Mongodb',
350
-          'Predis',
351
-          'Redis',
352
-          'Ssdb',
353
-          'Sqlite',
354
-          'Wincache',
355
-          'Xcache',
338
+            'Apc',
339
+            'Apcu',
340
+            'Cassandra',
341
+            'Couchbase',
342
+            'Couchdb',
343
+            'Devnull',
344
+            'Files',
345
+            'Leveldb',
346
+            'Memcache',
347
+            'Memcached',
348
+            'Memstatic',
349
+            'Mongodb',
350
+            'Predis',
351
+            'Redis',
352
+            'Ssdb',
353
+            'Sqlite',
354
+            'Wincache',
355
+            'Xcache',
356 356
         ];
357 357
     }
358 358
 
@@ -362,9 +362,9 @@  discard block
 block discarded – undo
362 362
     public static function getStaticAllDrivers()
363 363
     {
364 364
         return array_merge(self::getStaticSystemDrivers(), [
365
-          'Devtrue',
366
-          'Devfalse',
367
-          'Cookie',
365
+            'Devtrue',
366
+            'Devfalse',
367
+            'Cookie',
368 368
         ]);
369 369
     }
370 370
 
Please login to merge, or discard this patch.
src/phpFastCache/Drivers/Cassandra/Driver.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -75,16 +75,16 @@  discard block
 block discarded – undo
75 75
             try{
76 76
                 $cacheData = $this->encode($this->driverPreWrap($item));
77 77
                 $options = new Cassandra\ExecutionOptions([
78
-                  'arguments' => [
78
+                    'arguments' => [
79 79
                     'cache_uuid' => new Cassandra\Uuid(),
80 80
                     'cache_id' => $item->getKey(),
81 81
                     'cache_data' => $cacheData,
82 82
                     'cache_creation_date' => new Cassandra\Timestamp((new \DateTime())->getTimestamp()),
83 83
                     'cache_expiration_date' => new Cassandra\Timestamp($item->getExpirationDate()->getTimestamp()),
84 84
                     'cache_length' => strlen($cacheData)
85
-                  ],
86
-                  'consistency' => Cassandra::CONSISTENCY_ALL,
87
-                  'serial_consistency' => Cassandra::CONSISTENCY_SERIAL
85
+                    ],
86
+                    'consistency' => Cassandra::CONSISTENCY_ALL,
87
+                    'serial_consistency' => Cassandra::CONSISTENCY_SERIAL
88 88
                 ]);
89 89
 
90 90
                 $query = sprintf('INSERT INTO %s.%s
@@ -122,13 +122,13 @@  discard block
 block discarded – undo
122 122
     {
123 123
         try {
124 124
             $options = new Cassandra\ExecutionOptions([
125
-              'arguments' => ['cache_id' => $item->getKey()],
126
-              'page_size' => 1
125
+                'arguments' => ['cache_id' => $item->getKey()],
126
+                'page_size' => 1
127 127
             ]);
128 128
             $query = sprintf(
129
-              'SELECT cache_data FROM %s.%s WHERE cache_id = :cache_id;',
130
-              self::CASSANDRA_KEY_SPACE,
131
-              self::CASSANDRA_TABLE
129
+                'SELECT cache_data FROM %s.%s WHERE cache_id = :cache_id;',
130
+                self::CASSANDRA_KEY_SPACE,
131
+                self::CASSANDRA_TABLE
132 132
             );
133 133
             $results = $this->instance->execute(new Cassandra\SimpleStatement($query), $options);
134 134
 
@@ -155,14 +155,14 @@  discard block
 block discarded – undo
155 155
         if ($item instanceof Item) {
156 156
             try {
157 157
                 $options = new Cassandra\ExecutionOptions([
158
-                  'arguments' => [
158
+                    'arguments' => [
159 159
                     'cache_id' => $item->getKey(),
160
-                  ],
160
+                    ],
161 161
                 ]);
162 162
                 $result = $this->instance->execute(new Cassandra\SimpleStatement(sprintf(
163
-                  'DELETE FROM %s.%s WHERE cache_id = :cache_id;',
164
-                  self::CASSANDRA_KEY_SPACE,
165
-                  self::CASSANDRA_TABLE
163
+                    'DELETE FROM %s.%s WHERE cache_id = :cache_id;',
164
+                    self::CASSANDRA_KEY_SPACE,
165
+                    self::CASSANDRA_TABLE
166 166
                 )), $options);
167 167
 
168 168
                 /**
@@ -186,8 +186,8 @@  discard block
 block discarded – undo
186 186
     {
187 187
         try {
188 188
             $this->instance->execute(new Cassandra\SimpleStatement(sprintf(
189
-              'TRUNCATE %s.%s;',
190
-              self::CASSANDRA_KEY_SPACE, self::CASSANDRA_TABLE
189
+                'TRUNCATE %s.%s;',
190
+                self::CASSANDRA_KEY_SPACE, self::CASSANDRA_TABLE
191 191
             )));
192 192
 
193 193
             return true;
@@ -213,8 +213,8 @@  discard block
 block discarded – undo
213 213
             $username = isset($this->config[ 'username' ]) ? $this->config[ 'username' ] : '';
214 214
 
215 215
             $clusterBuilder = Cassandra::cluster()
216
-              ->withContactPoints($host)
217
-              ->withPort($port);
216
+                ->withContactPoints($host)
217
+                ->withPort($port);
218 218
 
219 219
             if(!empty($this->config['ssl']['enabled'])){
220 220
                 if(!empty($this->config['ssl']['verify'])){
@@ -242,8 +242,8 @@  discard block
 block discarded – undo
242 242
              */
243 243
 
244 244
             $this->instance->execute(new Cassandra\SimpleStatement(sprintf(
245
-              "CREATE KEYSPACE IF NOT EXISTS %s WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };",
246
-              self::CASSANDRA_KEY_SPACE
245
+                "CREATE KEYSPACE IF NOT EXISTS %s WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };",
246
+                self::CASSANDRA_KEY_SPACE
247 247
             )));
248 248
             $this->instance->execute(new Cassandra\SimpleStatement(sprintf('USE %s;', self::CASSANDRA_KEY_SPACE)));
249 249
             $this->instance->execute(new Cassandra\SimpleStatement(sprintf('
@@ -290,15 +290,15 @@  discard block
 block discarded – undo
290 290
     public function getStats()
291 291
     {
292 292
         $result = $this->instance->execute(new Cassandra\SimpleStatement(sprintf(
293
-          'SELECT SUM(cache_length) as cache_size FROM %s.%s',
294
-          self::CASSANDRA_KEY_SPACE,
295
-          self::CASSANDRA_TABLE
293
+            'SELECT SUM(cache_length) as cache_size FROM %s.%s',
294
+            self::CASSANDRA_KEY_SPACE,
295
+            self::CASSANDRA_TABLE
296 296
         )));
297 297
 
298 298
         return (new driverStatistic())
299
-          ->setSize($result->first()[ 'cache_size' ])
300
-          ->setRawData([])
301
-          ->setData(implode(', ', array_keys($this->itemInstances)))
302
-          ->setInfo('The cache size represents only the cache data itself without counting data structures associated to the cache entries.');
299
+            ->setSize($result->first()[ 'cache_size' ])
300
+            ->setRawData([])
301
+            ->setData(implode(', ', array_keys($this->itemInstances)))
302
+            ->setInfo('The cache size represents only the cache data itself without counting data structures associated to the cache entries.');
303 303
     }
304 304
 }
305 305
\ No newline at end of file
Please login to merge, or discard this patch.