Passed
Push — master ( 11fd86...bbec0f )
by y
01:25
created
src/DB/SQL/ComparisonTrait.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      * @param array $values
29 29
      * @return Value
30 30
      */
31
-    public function coalesce (array $values) {
31
+    public function coalesce(array $values) {
32 32
         array_unshift($values, $this);
33 33
         $values = $this->db->quoteList($values);
34 34
         return new Value($this->db, "COALESCE({$values})");
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      * @param array $values `[when => then]`
41 41
      * @return Choice
42 42
      */
43
-    public function getChoice (array $values) {
43
+    public function getChoice(array $values) {
44 44
         return new Choice($this->db, "{$this}", $values);
45 45
     }
46 46
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      * @param null|bool|number|string|Select $arg
54 54
      * @return Predicate
55 55
      */
56
-    public function is ($arg): Predicate {
56
+    public function is($arg): Predicate {
57 57
         $driver = $this->db->getDriver();
58 58
         if ($arg instanceof Select) {
59 59
             switch ($driver) {
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      * @param number|string $max
82 82
      * @return Predicate
83 83
      */
84
-    public function isBetween ($min, $max) {
84
+    public function isBetween($min, $max) {
85 85
         $min = $this->db->quote($min);
86 86
         $max = $this->db->quote($max);
87 87
         return new Predicate("{$this} BETWEEN {$min} AND {$max}");
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
      * @param bool|number|string|array|Select $arg
94 94
      * @return Predicate
95 95
      */
96
-    public function isEqual ($arg) {
96
+    public function isEqual($arg) {
97 97
         return $this->db->match($this, $arg);
98 98
     }
99 99
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      * @param string $multi `ALL|ANY`
110 110
      * @return Predicate
111 111
      */
112
-    public function isGreater ($arg, string $multi = 'ALL') {
112
+    public function isGreater($arg, string $multi = 'ALL') {
113 113
         if ($arg instanceof Select) {
114 114
             switch ($this->db) {
115 115
                 case 'sqlite':
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
      * @param string $multi `ALL|ANY`
140 140
      * @return Predicate
141 141
      */
142
-    public function isGreaterOrEqual ($arg, string $multi = 'ALL') {
142
+    public function isGreaterOrEqual($arg, string $multi = 'ALL') {
143 143
         if ($arg instanceof Select) {
144 144
             switch ($this->db) {
145 145
                 case 'sqlite':
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
      * @param string $multi `ALL|ANY`
170 170
      * @return Predicate
171 171
      */
172
-    public function isLess ($arg, string $multi = 'ALL') {
172
+    public function isLess($arg, string $multi = 'ALL') {
173 173
         if ($arg instanceof Select) {
174 174
             switch ($this->db) {
175 175
                 case 'sqlite':
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
      * @param string $multi `ALL|ANY`
200 200
      * @return Predicate
201 201
      */
202
-    public function isLessOrEqual ($arg, string $multi = 'ALL') {
202
+    public function isLessOrEqual($arg, string $multi = 'ALL') {
203 203
         if ($arg instanceof Select) {
204 204
             switch ($this->db) {
205 205
                 case 'sqlite':
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
      * @param string $pattern
224 224
      * @return Predicate
225 225
      */
226
-    public function isLike (string $pattern) {
226
+    public function isLike(string $pattern) {
227 227
         $pattern = $this->db->quote($pattern);
228 228
         return new Predicate("{$this} LIKE {$pattern}");
229 229
     }
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
      * @param null|bool|number|string|Select $arg
235 235
      * @return Predicate
236 236
      */
237
-    public function isNot ($arg) {
237
+    public function isNot($arg) {
238 238
         return $this->is($arg)->invert();
239 239
     }
240 240
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
      * @param number|string $max
246 246
      * @return Predicate
247 247
      */
248
-    public function isNotBetween ($min, $max) {
248
+    public function isNotBetween($min, $max) {
249 249
         $min = $this->db->quote($min);
250 250
         $max = $this->db->quote($max);
251 251
         return new Predicate("{$this} NOT BETWEEN {$min} AND {$max}");
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
      * @param bool|number|string|array|Select $arg
258 258
      * @return Predicate
259 259
      */
260
-    public function isNotEqual ($arg) {
260
+    public function isNotEqual($arg) {
261 261
         if ($arg instanceof Select) {
262 262
             return new Predicate("{$this} NOT IN ({$arg->toSql()})");
263 263
         }
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
      * @param string $pattern
274 274
      * @return Predicate
275 275
      */
276
-    public function isNotLike (string $pattern) {
276
+    public function isNotLike(string $pattern) {
277 277
         $pattern = $this->db->quote($pattern);
278 278
         return new Predicate("{$this} NOT LIKE {$pattern}");
279 279
     }
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
      * @param string $pattern
285 285
      * @return Predicate
286 286
      */
287
-    public function isNotRegExp (string $pattern) {
287
+    public function isNotRegExp(string $pattern) {
288 288
         $pattern = $this->db->quote($pattern);
289 289
         return new Predicate("{$this} NOT REGEXP {$pattern}");
290 290
     }
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
      * @param string $pattern
296 296
      * @return Predicate
297 297
      */
298
-    public function isRegExp (string $pattern) {
298
+    public function isRegExp(string $pattern) {
299 299
         $pattern = $this->db->quote($pattern);
300 300
         return new Predicate("{$this} REGEXP {$pattern}");
301 301
     }
Please login to merge, or discard this patch.
src/DB/SQL/Predicate.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
      * @param string[] $conditions
18 18
      * @return Predicate
19 19
      */
20
-    public static function all (array $conditions) {
20
+    public static function all(array $conditions) {
21 21
         if (count($conditions) === 1) {
22 22
             return reset($conditions);
23 23
         }
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      * @param string[] $conditions
31 31
      * @return Predicate
32 32
      */
33
-    public static function any (array $conditions) {
33
+    public static function any(array $conditions) {
34 34
         if (count($conditions) === 1) {
35 35
             return reset($conditions);
36 36
         }
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      *
43 43
      * @return Predicate
44 44
      */
45
-    public function invert () {
45
+    public function invert() {
46 46
         return new static("NOT({$this})");
47 47
     }
48 48
 }
49 49
\ No newline at end of file
Please login to merge, or discard this patch.
src/DB/Record.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      * @param string|EntityInterface $class
60 60
      * @return Record
61 61
      */
62
-    public static function fromClass (DB $db, $class) {
62
+    public static function fromClass(DB $db, $class) {
63 63
         try {
64 64
             $rClass = new ReflectionClass($class);
65 65
         }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      * @param string[] $columns Property names.
93 93
      * @param EAV[] $eav Keyed by property name.
94 94
      */
95
-    public function __construct (DB $db, EntityInterface $proto, string $table, array $columns, array $eav = []) {
95
+    public function __construct(DB $db, EntityInterface $proto, string $table, array $columns, array $eav = []) {
96 96
         parent::__construct($db, $table, $columns);
97 97
         $this->proto = $proto;
98 98
         try {
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      * @param array[] $eavMatch `[eav property => attribute => mixed]`
129 129
      * @return Select
130 130
      */
131
-    public function find (array $match, array $eavMatch = []) {
131
+    public function find(array $match, array $eavMatch = []) {
132 132
         $select = $this->select();
133 133
         foreach ($match as $a => $b) {
134 134
             $select->where($this->db->match($this[$a] ?? $a, $b));
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
      * @param Statement $statement
147 147
      * @return EntityInterface[] Enumerated
148 148
      */
149
-    public function getAll (Statement $statement): array {
149
+    public function getAll(Statement $statement): array {
150 150
         return iterator_to_array($this->getEach($statement));
151 151
     }
152 152
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      * @param Statement $statement
158 158
      * @return Generator
159 159
      */
160
-    public function getEach (Statement $statement) {
160
+    public function getEach(Statement $statement) {
161 161
         do {
162 162
             $entities = [];
163 163
             for ($i = 0; $i < 256 and false !== $row = $statement->fetch(); $i++) {
@@ -175,14 +175,14 @@  discard block
 block discarded – undo
175 175
      * @param string $property
176 176
      * @return EAV
177 177
      */
178
-    final public function getEav (string $property) {
178
+    final public function getEav(string $property) {
179 179
         return $this->eav[$property];
180 180
     }
181 181
 
182 182
     /**
183 183
      * @return EntityInterface
184 184
      */
185
-    public function getProto () {
185
+    public function getProto() {
186 186
         return $this->proto;
187 187
     }
188 188
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
      * @param EntityInterface $entity
191 191
      * @return array
192 192
      */
193
-    protected function getValues (EntityInterface $entity): array {
193
+    protected function getValues(EntityInterface $entity): array {
194 194
         $values = [];
195 195
         foreach (array_keys($this->columns) as $name) {
196 196
             $values[$name] = $this->properties[$name]->getValue($entity);
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
      * @param int $id
205 205
      * @return null|EntityInterface
206 206
      */
207
-    public function load (int $id) {
207
+    public function load(int $id) {
208 208
         $load = $this->cache(__FUNCTION__, function() {
209 209
             return $this->select(array_keys($this->columns))->where('id = ?')->prepare();
210 210
         });
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
      *
223 223
      * @param EntityInterface[] $entities
224 224
      */
225
-    protected function loadEav (array $entities): void {
225
+    protected function loadEav(array $entities): void {
226 226
         $ids = array_keys($entities);
227 227
         foreach ($this->eav as $name => $eav) {
228 228
             foreach ($eav->loadAll($ids) as $id => $values) {
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
      * @param EntityInterface $entity
240 240
      * @return int ID
241 241
      */
242
-    public function save (EntityInterface $entity): int {
242
+    public function save(EntityInterface $entity): int {
243 243
         if (!$entity->getId()) {
244 244
             $this->saveInsert($entity);
245 245
         }
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
     /**
254 254
      * @param EntityInterface $entity
255 255
      */
256
-    protected function saveEav (EntityInterface $entity): void {
256
+    protected function saveEav(EntityInterface $entity): void {
257 257
         $id = $entity->getId();
258 258
         foreach ($this->eav as $name => $eav) {
259 259
             $values = $this->properties[$name]->getValue($entity);
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
      *
269 269
      * @param EntityInterface $entity
270 270
      */
271
-    protected function saveInsert (EntityInterface $entity): void {
271
+    protected function saveInsert(EntityInterface $entity): void {
272 272
         $insert = $this->cache(__FUNCTION__, function() {
273 273
             $slots = SQL::slots(array_keys($this->columns));
274 274
             unset($slots['id']);
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
      *
287 287
      * @param EntityInterface $entity
288 288
      */
289
-    protected function saveUpdate (EntityInterface $entity): void {
289
+    protected function saveUpdate(EntityInterface $entity): void {
290 290
         $this->cache(__FUNCTION__, function() {
291 291
             $slots = SQL::slotsEqual(array_keys($this->columns));
292 292
             unset($slots['id']);
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
      * @param array $columns Defaults to all columns.
302 302
      * @return Select
303 303
      */
304
-    public function select (array $columns = []) {
304
+    public function select(array $columns = []) {
305 305
         $select = parent::select($columns);
306 306
         if (empty($columns)) {
307 307
             $select->setFetcher(function(Statement $statement) {
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
      * @param EntityInterface $proto
316 316
      * @return $this
317 317
      */
318
-    public function setProto (EntityInterface $proto) {
318
+    public function setProto(EntityInterface $proto) {
319 319
         $this->proto = $proto;
320 320
         return $this;
321 321
     }
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
      * @param EntityInterface $entity
325 325
      * @param array $values
326 326
      */
327
-    protected function setValues (EntityInterface $entity, array $values): void {
327
+    protected function setValues(EntityInterface $entity, array $values): void {
328 328
         foreach ($values as $name => $value) {
329 329
             settype($value, $this->types[$name]);
330 330
             $this->properties[$name]->setValue($entity, $value);
Please login to merge, or discard this patch.
src/DB.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      * @param string $passwd
53 53
      * @param array $options
54 54
      */
55
-    public function __construct ($dsn, $username = null, $passwd = null, $options = null) {
55
+    public function __construct($dsn, $username = null, $passwd = null, $options = null) {
56 56
         parent::__construct($dsn, $username, $passwd, $options);
57 57
         $this->driver = $this->getAttribute(self::ATTR_DRIVER_NAME);
58 58
         $this->setAttribute(self::ATTR_DEFAULT_FETCH_MODE, self::FETCH_ASSOC);
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      *
74 74
      * @return string
75 75
      */
76
-    final public function __toString () {
76
+    final public function __toString() {
77 77
         return $this->driver;
78 78
     }
79 79
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      * @param string $sql
84 84
      * @return int
85 85
      */
86
-    public function exec ($sql): int {
86
+    public function exec($sql): int {
87 87
         $this->logger->__invoke($sql);
88 88
         return parent::exec($sql);
89 89
     }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     /**
92 92
      * @return string
93 93
      */
94
-    final public function getDriver (): string {
94
+    final public function getDriver(): string {
95 95
         return $this->driver;
96 96
     }
97 97
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      * @param string $interface
102 102
      * @return Junction
103 103
      */
104
-    public function getJunction ($interface) {
104
+    public function getJunction($interface) {
105 105
         if (!isset($this->junctions[$interface])) {
106 106
             $this->junctions[$interface] = Junction::fromInterface($this, $interface);
107 107
         }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     /**
112 112
      * @return Closure
113 113
      */
114
-    public function getLogger () {
114
+    public function getLogger() {
115 115
         return $this->logger;
116 116
     }
117 117
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
      * @param string|EntityInterface $class
122 122
      * @return Record
123 123
      */
124
-    public function getRecord ($class) {
124
+    public function getRecord($class) {
125 125
         if (is_object($class)) {
126 126
             $class = get_class($class);
127 127
         }
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
      * @param mixed $b
149 149
      * @return Predicate
150 150
      */
151
-    public function match ($a, $b) {
151
+    public function match($a, $b) {
152 152
         if ($b instanceof Closure) {
153 153
             return $b->__invoke($a, $this);
154 154
         }
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
      * @param string $class Class or interface name.
169 169
      * @return bool
170 170
      */
171
-    public function offsetExists ($class): bool {
171
+    public function offsetExists($class): bool {
172 172
         return (bool)$this->offsetGet($class);
173 173
     }
174 174
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
      * @param string $class Class or interface name.
177 177
      * @return null|Record|Junction
178 178
      */
179
-    public function offsetGet ($class) {
179
+    public function offsetGet($class) {
180 180
         if (class_exists($class)) {
181 181
             return $this->getRecord($class);
182 182
         }
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
      * @param string $class Class or interface name.
191 191
      * @param Record|Junction $access
192 192
      */
193
-    public function offsetSet ($class, $access) {
193
+    public function offsetSet($class, $access) {
194 194
         if ($access instanceof Record) {
195 195
             $this->setRecord($class, $access);
196 196
         }
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
     /**
203 203
      * @param string $class Class or interface name.
204 204
      */
205
-    public function offsetUnset ($class) {
205
+    public function offsetUnset($class) {
206 206
         unset($this->records[$class]);
207 207
         unset($this->junctions[$class]);
208 208
     }
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
      * @param array $options
215 215
      * @return Statement
216 216
      */
217
-    public function prepare ($sql, $options = []) {
217
+    public function prepare($sql, $options = []) {
218 218
         $this->logger->__invoke($sql);
219 219
         /** @var Statement $statement */
220 220
         $statement = parent::prepare($sql, $options);
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
      * @param array $ctorargs
231 231
      * @return Statement
232 232
      */
233
-    public function query ($sql, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, array $ctorargs = []) {
233
+    public function query($sql, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, array $ctorargs = []) {
234 234
         $this->logger->__invoke($sql);
235 235
         /** @var Statement $statement */
236 236
         $statement = parent::query(...func_get_args());
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
      * @param int $type Ignored.
250 250
      * @return string
251 251
      */
252
-    public function quote ($value, $type = self::PARAM_STR) {
252
+    public function quote($value, $type = self::PARAM_STR) {
253 253
         if ($value instanceof ExpressionInterface) {
254 254
             return $value;
255 255
         }
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
      * @param array $values
270 270
      * @return string[]
271 271
      */
272
-    public function quoteArray (array $values): array {
272
+    public function quoteArray(array $values): array {
273 273
         return array_map([$this, 'quote'], $values);
274 274
     }
275 275
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
      * @param array $values
280 280
      * @return string
281 281
      */
282
-    public function quoteList (array $values): string {
282
+    public function quoteList(array $values): string {
283 283
         return implode(',', $this->quoteArray($values));
284 284
     }
285 285
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
      * @param EntityInterface $entity
290 290
      * @return int ID
291 291
      */
292
-    public function save (EntityInterface $entity): int {
292
+    public function save(EntityInterface $entity): int {
293 293
         return $this->getRecord($entity)->save($entity);
294 294
     }
295 295
 
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
      * @param Junction $junction
299 299
      * @return $this
300 300
      */
301
-    public function setJunction (string $interface, Junction $junction) {
301
+    public function setJunction(string $interface, Junction $junction) {
302 302
         $this->junctions[$interface] = $junction;
303 303
         return $this;
304 304
     }
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
      * @param Closure $logger
308 308
      * @return $this
309 309
      */
310
-    public function setLogger (Closure $logger) {
310
+    public function setLogger(Closure $logger) {
311 311
         $this->logger = $logger;
312 312
         return $this;
313 313
     }
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
      * @param Record $record
318 318
      * @return $this
319 319
      */
320
-    public function setRecord (string $class, Record $record) {
320
+    public function setRecord(string $class, Record $record) {
321 321
         $this->records[$class] = $record;
322 322
         return $this;
323 323
     }
Please login to merge, or discard this patch.
src/DB/Table.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      * @param string $name
40 40
      * @param string[] $columns
41 41
      */
42
-    public function __construct (DB $db, $name, array $columns) {
42
+    public function __construct(DB $db, $name, array $columns) {
43 43
         parent::__construct($db);
44 44
         $this->name = $name;
45 45
         asort($columns);
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      *
54 54
      * @return string
55 55
      */
56
-    final public function __toString () {
56
+    final public function __toString() {
57 57
         return $this->name;
58 58
     }
59 59
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      * @param array $values
64 64
      * @return int Rows affected.
65 65
      */
66
-    public function apply (array $values): int {
66
+    public function apply(array $values): int {
67 67
         $columns = implode(',', array_keys($values));
68 68
         $values = $this->db->quoteList($values);
69 69
         switch ($this->db) {
@@ -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] ?? $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 string $name
148 148
      * @return bool
149 149
      */
150
-    public function offsetExists ($name): bool {
150
+    public function offsetExists($name): bool {
151 151
         return isset($this->columns[$name]);
152 152
     }
153 153
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
      * @param string $name
156 156
      * @return Column
157 157
      */
158
-    public function offsetGet ($name) {
158
+    public function offsetGet($name) {
159 159
         return $this->columns[$name];
160 160
     }
161 161
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
      * @param string[] $columns Defaults to all columns.
166 166
      * @return Select
167 167
      */
168
-    public function select (array $columns = []) {
168
+    public function select(array $columns = []) {
169 169
         if (empty($columns)) {
170 170
             $columns = $this->columns;
171 171
         }
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
      * @param string $name
179 179
      * @return Table
180 180
      */
181
-    public function setName (string $name) {
181
+    public function setName(string $name) {
182 182
         $clone = clone $this;
183 183
         $clone->name = $name;
184 184
         foreach ($this->columns as $name => $column) {
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
      * @param array $match
197 197
      * @return int Rows affected.
198 198
      */
199
-    public function update (array $values, array $match): int {
199
+    public function update(array $values, array $match): int {
200 200
         foreach ($this->db->quoteArray($values) as $key => $value) {
201 201
             $values[$key] = "{$key} = {$value}";
202 202
         }
Please login to merge, or discard this patch.