Passed
Push — master ( 5d6c6e...7e3b1d )
by y
01:51
created
src/DB/Record.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -75,8 +75,7 @@  discard block
 block discarded – undo
75 75
             foreach ($rClass->getProperties() as $rProp) {
76 76
                 if (preg_match('/@col(umn)?[\s$]/', $rProp->getDocComment())) {
77 77
                     $columns[] = $rProp->getName();
78
-                }
79
-                elseif (preg_match('/@eav\s+(?<table>\S+)/', $rProp->getDocComment(), $attr)) {
78
+                } elseif (preg_match('/@eav\s+(?<table>\S+)/', $rProp->getDocComment(), $attr)) {
80 79
                     $eav[$rProp->getName()] = EAV::factory($db, $attr['table']);
81 80
                 }
82 81
             }
@@ -243,8 +242,7 @@  discard block
 block discarded – undo
243 242
     public function save (EntityInterface $entity): int {
244 243
         if (!$entity->getId()) {
245 244
             $this->saveInsert($entity);
246
-        }
247
-        else {
245
+        } else {
248 246
             $this->saveUpdate($entity);
249 247
         }
250 248
         $this->saveEav($entity);
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      * @param string|EntityInterface $class
67 67
      * @return Record
68 68
      */
69
-    public static function fromClass (DB $db, $class) {
69
+    public static function fromClass(DB $db, $class) {
70 70
         return (function() use ($db, $class) {
71 71
             $rClass = new ReflectionClass($class);
72 72
             $columns = [];
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      * @param string[] $columns Property names.
96 96
      * @param EAV[] $eav Keyed by property name.
97 97
      */
98
-    public function __construct (DB $db, EntityInterface $proto, string $table, array $columns, array $eav = []) {
98
+    public function __construct(DB $db, EntityInterface $proto, string $table, array $columns, array $eav = []) {
99 99
         parent::__construct($db, $table, $columns);
100 100
         $this->proto = $proto;
101 101
         (function() use ($proto, $columns, $eav) {
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
      * @param array[] $eavMatch `[eav property => attribute => mixed]`
133 133
      * @return Select
134 134
      */
135
-    public function find (array $match, array $eavMatch = []) {
135
+    public function find(array $match, array $eavMatch = []) {
136 136
         $select = $this->select();
137 137
         foreach ($match as $a => $b) {
138 138
             $select->where($this->db->match($this[$a] ?? $a, $b));
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      * @param Statement $statement
151 151
      * @return EntityInterface[] Keyed by ID
152 152
      */
153
-    public function getAll (Statement $statement): array {
153
+    public function getAll(Statement $statement): array {
154 154
         return iterator_to_array($this->getEach($statement));
155 155
     }
156 156
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
      * @param Statement $statement
162 162
      * @return Generator|EntityInterface[] Keyed by ID
163 163
      */
164
-    public function getEach (Statement $statement) {
164
+    public function getEach(Statement $statement) {
165 165
         do {
166 166
             $entities = [];
167 167
             for ($i = 0; $i < 256 and false !== $row = $statement->fetch(); $i++) {
@@ -178,14 +178,14 @@  discard block
 block discarded – undo
178 178
      * @param string $property
179 179
      * @return EAV
180 180
      */
181
-    final public function getEav (string $property) {
181
+    final public function getEav(string $property) {
182 182
         return $this->eav[$property];
183 183
     }
184 184
 
185 185
     /**
186 186
      * @return EntityInterface
187 187
      */
188
-    public function getProto () {
188
+    public function getProto() {
189 189
         return $this->proto;
190 190
     }
191 191
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
      * @param EntityInterface $entity
194 194
      * @return array
195 195
      */
196
-    protected function getValues (EntityInterface $entity): array {
196
+    protected function getValues(EntityInterface $entity): array {
197 197
         $values = [];
198 198
         foreach (array_keys($this->columns) as $name) {
199 199
             $values[$name] = $this->properties[$name]->getValue($entity);
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
      * @param int $id
208 208
      * @return null|EntityInterface
209 209
      */
210
-    public function load (int $id) {
210
+    public function load(int $id) {
211 211
         $statement = $this->cache(__FUNCTION__, function() {
212 212
             return $this->select(array_keys($this->columns))->where('id = ?')->prepare();
213 213
         });
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
      *
228 228
      * @param EntityInterface[] $entities
229 229
      */
230
-    protected function loadEav (array $entities): void {
230
+    protected function loadEav(array $entities): void {
231 231
         $ids = array_keys($entities);
232 232
         foreach ($this->eav as $name => $eav) {
233 233
             foreach ($eav->loadAll($ids) as $id => $values) {
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
      * @param EntityInterface $entity
243 243
      * @return int ID
244 244
      */
245
-    public function save (EntityInterface $entity): int {
245
+    public function save(EntityInterface $entity): int {
246 246
         if (!$entity->getId()) {
247 247
             $this->saveInsert($entity);
248 248
         }
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
     /**
257 257
      * @param EntityInterface $entity
258 258
      */
259
-    protected function saveEav (EntityInterface $entity): void {
259
+    protected function saveEav(EntityInterface $entity): void {
260 260
         $id = $entity->getId();
261 261
         foreach ($this->eav as $name => $eav) {
262 262
             // may be null to skip
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
      *
273 273
      * @param EntityInterface $entity
274 274
      */
275
-    protected function saveInsert (EntityInterface $entity): void {
275
+    protected function saveInsert(EntityInterface $entity): void {
276 276
         $statement = $this->cache(__FUNCTION__, function() {
277 277
             $slots = SQL::slots(array_keys($this->columns));
278 278
             unset($slots['id']);
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
      *
292 292
      * @param EntityInterface $entity
293 293
      */
294
-    protected function saveUpdate (EntityInterface $entity): void {
294
+    protected function saveUpdate(EntityInterface $entity): void {
295 295
         $statement = $this->cache(__FUNCTION__, function() {
296 296
             $slots = SQL::slotsEqual(array_keys($this->columns));
297 297
             unset($slots['id']);
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
      * @param array $columns Defaults to all columns.
309 309
      * @return Select
310 310
      */
311
-    public function select (array $columns = []) {
311
+    public function select(array $columns = []) {
312 312
         $select = parent::select($columns);
313 313
         if (empty($columns)) {
314 314
             $select->setFetcher(function(Statement $statement) {
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
      * @param EntityInterface $proto
323 323
      * @return $this
324 324
      */
325
-    public function setProto (EntityInterface $proto) {
325
+    public function setProto(EntityInterface $proto) {
326 326
         $this->proto = $proto;
327 327
         return $this;
328 328
     }
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
      * @param EntityInterface $entity
332 332
      * @param array $values
333 333
      */
334
-    protected function setValues (EntityInterface $entity, array $values): void {
334
+    protected function setValues(EntityInterface $entity, array $values): void {
335 335
         foreach ($values as $name => $value) {
336 336
             settype($value, $this->types[$name]);
337 337
             $this->properties[$name]->setValue($entity, $value);
Please login to merge, or discard this patch.
src/DB/Table.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      * @param string $name
43 43
      * @param string[] $columns
44 44
      */
45
-    public function __construct (DB $db, string $name, array $columns) {
45
+    public function __construct(DB $db, string $name, array $columns) {
46 46
         parent::__construct($db);
47 47
         $this->name = $name;
48 48
         foreach ($columns as $column) {
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      *
56 56
      * @return string
57 57
      */
58
-    final public function __toString () {
58
+    final public function __toString() {
59 59
         return $this->name;
60 60
     }
61 61
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      * @param array $values
66 66
      * @return int Rows affected.
67 67
      */
68
-    public function apply (array $values): int {
68
+    public function apply(array $values): int {
69 69
         $columns = implode(',', array_keys($values));
70 70
         $values = $this->db->quoteList($values);
71 71
         if ($this->db->isSQLite()) {
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      * @param Closure $prepare `():Statement`
86 86
      * @return Statement
87 87
      */
88
-    protected function cache (string $key, Closure $prepare) {
88
+    protected function cache(string $key, Closure $prepare) {
89 89
         return $this->_cache[$key] ??= $prepare->__invoke();
90 90
     }
91 91
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
      * @param array $match `[a => b]`
94 94
      * @return int
95 95
      */
96
-    public function count (array $match = []) {
96
+    public function count(array $match = []) {
97 97
         $select = $this->select(['COUNT(*)']);
98 98
         foreach ($match as $a => $b) {
99 99
             $select->where($this->db->match($this[$a] ?? $a, $b));
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      * @param array $match
110 110
      * @return int Rows affected.
111 111
      */
112
-    public function delete (array $match): int {
112
+    public function delete(array $match): int {
113 113
         foreach ($match as $a => $b) {
114 114
             $match[$a] = $this->db->match($this[$a] ?? $a, $b);
115 115
         }
@@ -120,14 +120,14 @@  discard block
 block discarded – undo
120 120
     /**
121 121
      * @return Column[]
122 122
      */
123
-    final public function getColumns (): array {
123
+    final public function getColumns(): array {
124 124
         return $this->columns;
125 125
     }
126 126
 
127 127
     /**
128 128
      * @return string
129 129
      */
130
-    final public function getName (): string {
130
+    final public function getName(): string {
131 131
         return $this->name;
132 132
     }
133 133
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
      * @param array $values
138 138
      * @return Statement
139 139
      */
140
-    public function insert (array $values) {
140
+    public function insert(array $values) {
141 141
         $columns = implode(',', array_keys($values));
142 142
         $values = $this->db->quoteList($values);
143 143
         return $this->db->query("INSERT INTO {$this} ($columns) VALUES ($values)");
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
      * @param int|string $column
148 148
      * @return Column
149 149
      */
150
-    public function offsetGet ($column) {
150
+    public function offsetGet($column) {
151 151
         if (is_int($column)) {
152 152
             return current(array_slice($this->columns, $column, 1)) ?: null;
153 153
         }
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
      * @param string[] $columns Defaults to all columns.
161 161
      * @return Select
162 162
      */
163
-    public function select (array $columns = []) {
163
+    public function select(array $columns = []) {
164 164
         if (empty($columns)) {
165 165
             $columns = $this->columns;
166 166
         }
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
      * @param string $name
174 174
      * @return Table
175 175
      */
176
-    public function setName (string $name) {
176
+    public function setName(string $name) {
177 177
         $clone = clone $this;
178 178
         $clone->name = $name;
179 179
         foreach ($this->columns as $name => $column) {
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
      * @param array $match
192 192
      * @return int Rows affected.
193 193
      */
194
-    public function update (array $values, array $match): int {
194
+    public function update(array $values, array $match): int {
195 195
         foreach ($this->db->quoteArray($values) as $key => $value) {
196 196
             $values[$key] = "{$key} = {$value}";
197 197
         }
Please login to merge, or discard this patch.
src/DB/EAV.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
      * @param DB $db
16 16
      * @param string $name
17 17
      */
18
-    public function __construct (DB $db, string $name) {
18
+    public function __construct(DB $db, string $name) {
19 19
         parent::__construct($db, $name, ['entity', 'attribute', 'value']);
20 20
     }
21 21
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      * @param string $attribute
27 27
      * @return bool
28 28
      */
29
-    public function exists (int $id, string $attribute): bool {
29
+    public function exists(int $id, string $attribute): bool {
30 30
         $statement = $this->cache(__FUNCTION__, function() {
31 31
             return $this->select(['COUNT(*) > 0'])->where('entity = ? AND attribute = ?')->prepare();
32 32
         });
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      * @param array $match `[attribute => value]`. If empty, selects all IDs for entities having at least one attribute.
45 45
      * @return Select
46 46
      */
47
-    public function find (array $match) {
47
+    public function find(array $match) {
48 48
         $select = $this->select([$this['entity']]);
49 49
         $prior = $this;
50 50
         foreach ($match as $attribute => $value) {
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      * @param int $id
67 67
      * @return array `[attribute => value]`
68 68
      */
69
-    public function load (int $id): array {
69
+    public function load(int $id): array {
70 70
         $statement = $this->cache(__FUNCTION__, function() {
71 71
             $select = $this->select(['attribute', 'value']);
72 72
             $select->where('entity = ?');
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      * @param int[] $ids
83 83
      * @return array[] `[id => attribute => value]
84 84
      */
85
-    public function loadAll (array $ids): array {
85
+    public function loadAll(array $ids): array {
86 86
         if (empty($ids)) {
87 87
             return [];
88 88
         }
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
      * @param array $values `[attribute => value]`
108 108
      * @return $this
109 109
      */
110
-    public function save (int $id, array $values) {
110
+    public function save(int $id, array $values) {
111 111
         $this->delete([
112 112
             $this['entity']->isEqual($id),
113 113
             $this['attribute']->isNotEqual(array_keys($values))
Please login to merge, or discard this patch.
src/DB.php 2 patches
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      * @param string $password
60 60
      * @param array $options
61 61
      */
62
-    public function __construct ($dsn, $username = null, $password = null, $options = null) {
62
+    public function __construct($dsn, $username = null, $password = null, $options = null) {
63 63
         parent::__construct($dsn, $username, $password, $options);
64 64
         $this->driver = $this->getAttribute(self::ATTR_DRIVER_NAME);
65 65
         $this->setAttribute(self::ATTR_DEFAULT_FETCH_MODE, self::FETCH_ASSOC);
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      *
82 82
      * @return string
83 83
      */
84
-    final public function __toString () {
84
+    final public function __toString() {
85 85
         return $this->driver;
86 86
     }
87 87
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      * @param string $sql
92 92
      * @return int
93 93
      */
94
-    public function exec ($sql): int {
94
+    public function exec($sql): int {
95 95
         $this->logger->__invoke($sql);
96 96
         return parent::exec($sql);
97 97
     }
@@ -107,14 +107,14 @@  discard block
 block discarded – undo
107 107
      * @param mixed ...$args
108 108
      * @return mixed
109 109
      */
110
-    public function factory (string $class, ...$args) {
110
+    public function factory(string $class, ...$args) {
111 111
         return new $class($this, ...$args);
112 112
     }
113 113
 
114 114
     /**
115 115
      * @return string
116 116
      */
117
-    final public function getDriver (): string {
117
+    final public function getDriver(): string {
118 118
         return $this->driver;
119 119
     }
120 120
 
@@ -124,14 +124,14 @@  discard block
 block discarded – undo
124 124
      * @param string $interface
125 125
      * @return Junction
126 126
      */
127
-    public function getJunction ($interface) {
127
+    public function getJunction($interface) {
128 128
         return $this->junctions[$interface] ??= Junction::fromInterface($this, $interface);
129 129
     }
130 130
 
131 131
     /**
132 132
      * @return Closure
133 133
      */
134
-    public function getLogger () {
134
+    public function getLogger() {
135 135
         return $this->logger;
136 136
     }
137 137
 
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      * @param string|EntityInterface $class
142 142
      * @return Record
143 143
      */
144
-    public function getRecord ($class) {
144
+    public function getRecord($class) {
145 145
         if (is_object($class)) {
146 146
             $class = get_class($class);
147 147
         }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
      * @param string $name
153 153
      * @return null|Table
154 154
      */
155
-    public function getTable (string $name) {
155
+    public function getTable(string $name) {
156 156
         if (!isset($this->tables[$name])) {
157 157
             if ($this->isSQLite()) {
158 158
                 $info = $this->query("PRAGMA table_info({$this->quote($name)})")->fetchAll();
@@ -174,21 +174,21 @@  discard block
 block discarded – undo
174 174
     /**
175 175
      * @return bool
176 176
      */
177
-    final public function isMySQL (): bool {
177
+    final public function isMySQL(): bool {
178 178
         return $this->driver === 'mysql';
179 179
     }
180 180
 
181 181
     /**
182 182
      * @return bool
183 183
      */
184
-    final public function isPostgreSQL (): bool {
184
+    final public function isPostgreSQL(): bool {
185 185
         return $this->driver === 'pgsql';
186 186
     }
187 187
 
188 188
     /**
189 189
      * @return bool
190 190
      */
191
-    final public function isSQLite (): bool {
191
+    final public function isSQLite(): bool {
192 192
         return $this->driver === 'sqlite';
193 193
     }
194 194
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
      * @param mixed $b
210 210
      * @return Predicate
211 211
      */
212
-    public function match ($a, $b) {
212
+    public function match($a, $b) {
213 213
         if ($b instanceof Closure) {
214 214
             return $b->__invoke($a, $this);
215 215
         }
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
      * @param string $table
232 232
      * @return bool
233 233
      */
234
-    final public function offsetExists ($table): bool {
234
+    final public function offsetExists($table): bool {
235 235
         return (bool)$this->getTable($table);
236 236
     }
237 237
 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
      * @param string $table
242 242
      * @return null|Table
243 243
      */
244
-    final public function offsetGet ($table) {
244
+    final public function offsetGet($table) {
245 245
         return $this->getTable($table);
246 246
     }
247 247
 
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
      * @param $value
251 251
      * @throws LogicException
252 252
      */
253
-    final public function offsetSet ($offset, $value) {
253
+    final public function offsetSet($offset, $value) {
254 254
         throw new LogicException('Raw table access is immutable.');
255 255
     }
256 256
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
      * @param $offset
259 259
      * @throws LogicException
260 260
      */
261
-    final public function offsetUnset ($offset) {
261
+    final public function offsetUnset($offset) {
262 262
         throw new LogicException('Raw table access is immutable.');
263 263
     }
264 264
 
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
      * @param array $options
270 270
      * @return Statement
271 271
      */
272
-    public function prepare ($sql, $options = []) {
272
+    public function prepare($sql, $options = []) {
273 273
         $this->logger->__invoke($sql);
274 274
         /** @var Statement $statement */
275 275
         $statement = parent::prepare($sql, $options);
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
      * @param array $ctorargs Optional.
286 286
      * @return Statement
287 287
      */
288
-    public function query ($sql, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, array $ctorargs = []) {
288
+    public function query($sql, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, array $ctorargs = []) {
289 289
         $this->logger->__invoke($sql);
290 290
         /** @var Statement $statement */
291 291
         $statement = parent::query(...func_get_args());
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
      * @param int $type Ignored.
304 304
      * @return string|ExpressionInterface
305 305
      */
306
-    public function quote ($value, $type = self::PARAM_STR) {
306
+    public function quote($value, $type = self::PARAM_STR) {
307 307
         if ($value instanceof ExpressionInterface) {
308 308
             return $value;
309 309
         }
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
      * @param array $values
324 324
      * @return string[]
325 325
      */
326
-    public function quoteArray (array $values) {
326
+    public function quoteArray(array $values) {
327 327
         return array_map([$this, 'quote'], $values);
328 328
     }
329 329
 
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
      * @param array $values
334 334
      * @return string
335 335
      */
336
-    public function quoteList (array $values): string {
336
+    public function quoteList(array $values): string {
337 337
         return implode(',', $this->quoteArray($values));
338 338
     }
339 339
 
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
      * @param EntityInterface $entity
344 344
      * @return int ID
345 345
      */
346
-    public function save (EntityInterface $entity): int {
346
+    public function save(EntityInterface $entity): int {
347 347
         return $this->getRecord($entity)->save($entity);
348 348
     }
349 349
 
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
      * @param Junction $junction
353 353
      * @return $this
354 354
      */
355
-    public function setJunction (string $interface, Junction $junction) {
355
+    public function setJunction(string $interface, Junction $junction) {
356 356
         $this->junctions[$interface] = $junction;
357 357
         return $this;
358 358
     }
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
      * @param Closure $logger
362 362
      * @return $this
363 363
      */
364
-    public function setLogger (Closure $logger) {
364
+    public function setLogger(Closure $logger) {
365 365
         $this->logger = $logger;
366 366
         return $this;
367 367
     }
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
      * @param Record $record
372 372
      * @return $this
373 373
      */
374
-    public function setRecord (string $class, Record $record) {
374
+    public function setRecord(string $class, Record $record) {
375 375
         $this->records[$class] = $record;
376 376
         return $this;
377 377
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -157,8 +157,7 @@
 block discarded – undo
157 157
             if ($this->isSQLite()) {
158 158
                 $info = $this->query("PRAGMA table_info({$this->quote($name)})")->fetchAll();
159 159
                 $cols = array_column($info, 'name');
160
-            }
161
-            else {
160
+            } else {
162 161
                 $cols = $this->query(
163 162
                     "SELECT column_name FROM information_schema.tables WHERE table_name = {$this->quote($name)}"
164 163
                 )->fetchAll(self::FETCH_COLUMN);
Please login to merge, or discard this patch.