@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | { |
| 43 | 43 | $placeholders = []; |
| 44 | 44 | |
| 45 | - for ($index = 0; $index < count($values); $index++) { |
|
| 45 | + for ($index = 0; $index<count($values); $index++) { |
|
| 46 | 46 | $placeholders[] = "(:key_{$index}, :data_{$index}, :expires)"; |
| 47 | 47 | } |
| 48 | 48 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | { |
| 94 | 94 | $placeholders = []; |
| 95 | 95 | |
| 96 | - for ($index=0; $index<count($keys); $index++) { |
|
| 96 | + for ($index = 0; $index<count($keys); $index++) { |
|
| 97 | 97 | $placeholders[] = ":key_{$index}"; |
| 98 | 98 | } |
| 99 | 99 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | { |
| 113 | 113 | $placeholders = []; |
| 114 | 114 | |
| 115 | - for ($index=0; $index<count($keys); $index++) { |
|
| 115 | + for ($index = 0; $index<count($keys); $index++) { |
|
| 116 | 116 | $placeholders[] = ":key_{$index}"; |
| 117 | 117 | } |
| 118 | 118 | |
@@ -13,10 +13,10 @@ |
||
| 13 | 13 | $this->unsafeExecute( |
| 14 | 14 | $this->prepare( |
| 15 | 15 | "CREATE TABLE IF NOT EXISTS `{$this->table_name}` (\n" |
| 16 | - . " `key` VARCHAR(512) NOT NULL COLLATE 'latin1_bin',\n" |
|
| 17 | - . " `data` MEDIUMBLOB NOT NULL,\n" |
|
| 18 | - . " `expires` BIGINT NOT NULL,\n" |
|
| 19 | - . " PRIMARY KEY (`key`),\n" |
|
| 16 | + . " `key` VARCHAR(512) NOT NULL COLLATE 'latin1_bin',\n" |
|
| 17 | + . " `data` MEDIUMBLOB NOT NULL,\n" |
|
| 18 | + . " `expires` BIGINT NOT NULL,\n" |
|
| 19 | + . " PRIMARY KEY (`key`),\n" |
|
| 20 | 20 | . " INDEX `expires` (`expires`)\n" |
| 21 | 21 | . ")" |
| 22 | 22 | ) |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | $placeholders = []; |
| 40 | 40 | |
| 41 | - for ($index = 0; $index < count($values); $index++) { |
|
| 41 | + for ($index = 0; $index<count($values); $index++) { |
|
| 42 | 42 | $placeholders[] = "(:key_{$index}, :data_{$index}, :expires)"; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | { |
| 89 | 89 | $placeholders = []; |
| 90 | 90 | |
| 91 | - for ($index=0; $index<count($keys); $index++) { |
|
| 91 | + for ($index = 0; $index<count($keys); $index++) { |
|
| 92 | 92 | $placeholders[] = ":key_{$index}"; |
| 93 | 93 | } |
| 94 | 94 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | { |
| 108 | 108 | $placeholders = []; |
| 109 | 109 | |
| 110 | - for ($index=0; $index<count($keys); $index++) { |
|
| 110 | + for ($index = 0; $index<count($keys); $index++) { |
|
| 111 | 111 | $placeholders[] = ":key_{$index}"; |
| 112 | 112 | } |
| 113 | 113 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | return $default; // entry not found |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - if ($this->getTime() >= $entry->expires) { |
|
| 66 | + if ($this->getTime()>=$entry->expires) { |
|
| 67 | 67 | return $default; // entry expired |
| 68 | 68 | } |
| 69 | 69 | |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | public function getMultiple($keys, $default = null) |
| 111 | 111 | { |
| 112 | - if (! is_array($keys)) { |
|
| 112 | + if (!is_array($keys)) { |
|
| 113 | 113 | if ($keys instanceof Traversable) { |
| 114 | 114 | $keys = iterator_to_array($keys, false); |
| 115 | 115 | } else { |
@@ -144,14 +144,14 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | public function setMultiple($values, $ttl = null) |
| 146 | 146 | { |
| 147 | - if (! is_array($values) && ! $values instanceof Traversable) { |
|
| 147 | + if (!is_array($values) && !$values instanceof Traversable) { |
|
| 148 | 148 | throw new InvalidArgumentException("keys must be either of type array or Traversable"); |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | $data = []; |
| 152 | 152 | |
| 153 | 153 | foreach ($values as $key => $value) { |
| 154 | - if (! is_int($key)) { |
|
| 154 | + if (!is_int($key)) { |
|
| 155 | 155 | $this->validateKey($key); |
| 156 | 156 | } |
| 157 | 157 | |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | public function deleteMultiple($keys) |
| 167 | 167 | { |
| 168 | - if (! is_array($keys)) { |
|
| 168 | + if (!is_array($keys)) { |
|
| 169 | 169 | if ($keys instanceof Traversable) { |
| 170 | 170 | $keys = iterator_to_array($keys, false); |
| 171 | 171 | } else { |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | |
| 216 | 216 | private function validateKey($key): void |
| 217 | 217 | { |
| 218 | - if (! is_string($key)) { |
|
| 218 | + if (!is_string($key)) { |
|
| 219 | 219 | $type = is_object($key) ? get_class($key) : gettype($key); |
| 220 | 220 | |
| 221 | 221 | throw new InvalidArgumentException("invalid key type: {$type} given"); |