Skip to content

Commit d475d8c

Browse files
committed
Update coding standard
1 parent d6892c9 commit d475d8c

10 files changed

Lines changed: 148 additions & 75 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
},
4141
"require-dev": {
4242
"ext-xdebug": "*",
43-
"aplus/coding-standard": "^1.12",
43+
"aplus/coding-standard": "^1.13",
4444
"ergebnis/composer-normalize": "^2.25",
4545
"jetbrains/phpstorm-attributes": "^1.0",
4646
"phpmd/phpmd": "^2.12",

src/Database.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ protected function connect(
160160
string $schema = null,
161161
string $host = 'localhost',
162162
int $port = 3306
163-
) : static {
163+
) : static
164+
{
164165
if ( ! \is_array($username)) {
165166
$username = [
166167
'host' => $host,

src/Debug/DatabaseCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function getContents() : string
7777
<td>
7878
<pre><code class="language-sql"><?=
7979
\htmlentities($item['statement'])
80-
?></code></pre>
80+
?></code></pre>
8181
</td>
8282
<td><?= $item['rows'] ?></td>
8383
</tr>

src/Manipulation/Delete.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ protected function renderOptions() : ?string
7474
public function table(
7575
array | Closure | string $reference,
7676
array | Closure | string ...$references
77-
) : static {
77+
) : static
78+
{
7879
$this->sql['table'] = [];
7980
foreach ([$reference, ...$references] as $reference) {
8081
$this->sql['table'][] = $reference;

src/Manipulation/Select.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ protected function renderOptions() : ?string
236236
public function expressions(
237237
array | Closure | string $expression,
238238
array | Closure | string ...$expressions
239-
) : static {
239+
) : static
240+
{
240241
foreach ([$expression, ...$expressions] as $expression) {
241242
$this->sql['expressions'][] = $expression;
242243
}
@@ -254,7 +255,8 @@ public function expressions(
254255
public function columns(
255256
array | Closure | string $expression,
256257
array | Closure | string ...$expressions
257-
) : static {
258+
) : static
259+
{
258260
return $this->expressions($expression, ...$expressions);
259261
}
260262

@@ -335,7 +337,8 @@ public function intoOutfile(
335337
string $charset = null,
336338
array $fieldsOptions = [],
337339
array $linesOptions = []
338-
) : static {
340+
) : static
341+
{
339342
$this->sql['into_outfile'] = [
340343
'filename' => $filename,
341344
'charset' => $charset,

src/Manipulation/Traits/Having.php

Lines changed: 58 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ public function having(
3333
Closure | string $column,
3434
string $operator,
3535
Closure | float | int | string | null ...$values
36-
) : static {
36+
) : static
37+
{
3738
return $this->addHaving('AND', $column, $operator, $values);
3839
}
3940

@@ -50,7 +51,8 @@ public function orHaving(
5051
Closure | string $column,
5152
string $operator,
5253
Closure | float | int | string | null ...$values
53-
) : static {
54+
) : static
55+
{
5456
return $this->addHaving('OR', $column, $operator, $values);
5557
}
5658

@@ -67,7 +69,8 @@ public function orHaving(
6769
public function havingEqual(
6870
Closure | string $column,
6971
Closure | float | int | string | null $value
70-
) : static {
72+
) : static
73+
{
7174
return $this->having($column, '=', $value);
7275
}
7376

@@ -84,7 +87,8 @@ public function havingEqual(
8487
public function orHavingEqual(
8588
Closure | string $column,
8689
Closure | float | int | string | null $value
87-
) : static {
90+
) : static
91+
{
8892
return $this->orHaving($column, '=', $value);
8993
}
9094

@@ -101,7 +105,8 @@ public function orHavingEqual(
101105
public function havingNotEqual(
102106
Closure | string $column,
103107
Closure | float | int | string | null $value
104-
) : static {
108+
) : static
109+
{
105110
return $this->having($column, '!=', $value);
106111
}
107112

@@ -118,7 +123,8 @@ public function havingNotEqual(
118123
public function orHavingNotEqual(
119124
Closure | string $column,
120125
Closure | float | int | string | null $value
121-
) : static {
126+
) : static
127+
{
122128
return $this->orHaving($column, '!=', $value);
123129
}
124130

@@ -135,7 +141,8 @@ public function orHavingNotEqual(
135141
public function havingNullSafeEqual(
136142
Closure | string $column,
137143
Closure | float | int | string | null $value
138-
) : static {
144+
) : static
145+
{
139146
return $this->having($column, '<=>', $value);
140147
}
141148

@@ -152,7 +159,8 @@ public function havingNullSafeEqual(
152159
public function orHavingNullSafeEqual(
153160
Closure | string $column,
154161
Closure | float | int | string | null $value
155-
) : static {
162+
) : static
163+
{
156164
return $this->orHaving($column, '<=>', $value);
157165
}
158166

@@ -169,7 +177,8 @@ public function orHavingNullSafeEqual(
169177
public function havingLessThan(
170178
Closure | string $column,
171179
Closure | float | int | string | null $value
172-
) : static {
180+
) : static
181+
{
173182
return $this->having($column, '<', $value);
174183
}
175184

@@ -186,7 +195,8 @@ public function havingLessThan(
186195
public function orHavingLessThan(
187196
Closure | string $column,
188197
Closure | float | int | string | null $value
189-
) : static {
198+
) : static
199+
{
190200
return $this->orHaving($column, '<', $value);
191201
}
192202

@@ -203,7 +213,8 @@ public function orHavingLessThan(
203213
public function havingLessThanOrEqual(
204214
Closure | string $column,
205215
Closure | float | int | string | null $value
206-
) : static {
216+
) : static
217+
{
207218
return $this->having($column, '<=', $value);
208219
}
209220

@@ -220,7 +231,8 @@ public function havingLessThanOrEqual(
220231
public function orHavingLessThanOrEqual(
221232
Closure | string $column,
222233
Closure | float | int | string | null $value
223-
) : static {
234+
) : static
235+
{
224236
return $this->orHaving($column, '<=', $value);
225237
}
226238

@@ -237,7 +249,8 @@ public function orHavingLessThanOrEqual(
237249
public function havingGreaterThan(
238250
Closure | string $column,
239251
Closure | float | int | string | null $value
240-
) : static {
252+
) : static
253+
{
241254
return $this->having($column, '>', $value);
242255
}
243256

@@ -254,7 +267,8 @@ public function havingGreaterThan(
254267
public function orHavingGreaterThan(
255268
Closure | string $column,
256269
Closure | float | int | string | null $value
257-
) : static {
270+
) : static
271+
{
258272
return $this->orHaving($column, '>', $value);
259273
}
260274

@@ -271,7 +285,8 @@ public function orHavingGreaterThan(
271285
public function havingGreaterThanOrEqual(
272286
Closure | string $column,
273287
Closure | float | int | string | null $value
274-
) : static {
288+
) : static
289+
{
275290
return $this->having($column, '>=', $value);
276291
}
277292

@@ -288,7 +303,8 @@ public function havingGreaterThanOrEqual(
288303
public function orHavingGreaterThanOrEqual(
289304
Closure | string $column,
290305
Closure | float | int | string | null $value
291-
) : static {
306+
) : static
307+
{
292308
return $this->orHaving($column, '>=', $value);
293309
}
294310

@@ -305,7 +321,8 @@ public function orHavingGreaterThanOrEqual(
305321
public function havingLike(
306322
Closure | string $column,
307323
Closure | float | int | string | null $value
308-
) : static {
324+
) : static
325+
{
309326
return $this->having($column, 'LIKE', $value);
310327
}
311328

@@ -322,7 +339,8 @@ public function havingLike(
322339
public function orHavingLike(
323340
Closure | string $column,
324341
Closure | float | int | string | null $value
325-
) : static {
342+
) : static
343+
{
326344
return $this->orHaving($column, 'LIKE', $value);
327345
}
328346

@@ -339,7 +357,8 @@ public function orHavingLike(
339357
public function havingNotLike(
340358
Closure | string $column,
341359
Closure | float | int | string | null $value
342-
) : static {
360+
) : static
361+
{
343362
return $this->having($column, 'NOT LIKE', $value);
344363
}
345364

@@ -356,7 +375,8 @@ public function havingNotLike(
356375
public function orHavingNotLike(
357376
Closure | string $column,
358377
Closure | float | int | string | null $value
359-
) : static {
378+
) : static
379+
{
360380
return $this->orHaving($column, 'NOT LIKE', $value);
361381
}
362382

@@ -375,7 +395,8 @@ public function havingIn(
375395
Closure | string $column,
376396
Closure | float | int | string | null $value,
377397
Closure | float | int | string | null ...$values
378-
) : static {
398+
) : static
399+
{
379400
return $this->having($column, 'IN', ...[$value, ...$values]);
380401
}
381402

@@ -394,7 +415,8 @@ public function orHavingIn(
394415
Closure | string $column,
395416
Closure | float | int | string | null $value,
396417
Closure | float | int | string | null ...$values
397-
) : static {
418+
) : static
419+
{
398420
return $this->orHaving($column, 'IN', ...[$value, ...$values]);
399421
}
400422

@@ -413,7 +435,8 @@ public function havingNotIn(
413435
Closure | string $column,
414436
Closure | float | int | string | null $value,
415437
Closure | float | int | string | null ...$values
416-
) : static {
438+
) : static
439+
{
417440
return $this->having($column, 'NOT IN', ...[$value, ...$values]);
418441
}
419442

@@ -432,7 +455,8 @@ public function orHavingNotIn(
432455
Closure | string $column,
433456
Closure | float | int | string | null $value,
434457
Closure | float | int | string | null ...$values
435-
) : static {
458+
) : static
459+
{
436460
return $this->orHaving($column, 'NOT IN', ...[$value, ...$values]);
437461
}
438462

@@ -451,7 +475,8 @@ public function havingBetween(
451475
Closure | string $column,
452476
Closure | float | int | string | null $min,
453477
Closure | float | int | string | null $max
454-
) : static {
478+
) : static
479+
{
455480
return $this->having($column, 'BETWEEN', $min, $max);
456481
}
457482

@@ -470,7 +495,8 @@ public function orHavingBetween(
470495
Closure | string $column,
471496
Closure | float | int | string | null $min,
472497
Closure | float | int | string | null $max
473-
) : static {
498+
) : static
499+
{
474500
return $this->orHaving($column, 'BETWEEN', $min, $max);
475501
}
476502

@@ -489,7 +515,8 @@ public function havingNotBetween(
489515
Closure | string $column,
490516
Closure | float | int | string | null $min,
491517
Closure | float | int | string | null $max
492-
) : static {
518+
) : static
519+
{
493520
return $this->having($column, 'NOT BETWEEN', $min, $max);
494521
}
495522

@@ -508,7 +535,8 @@ public function orHavingNotBetween(
508535
Closure | string $column,
509536
Closure | float | int | string | null $min,
510537
Closure | float | int | string | null $max
511-
) : static {
538+
) : static
539+
{
512540
return $this->orHaving($column, 'NOT BETWEEN', $min, $max);
513541
}
514542

@@ -585,7 +613,8 @@ private function addHaving(
585613
array | Closure | string $column,
586614
string $operator,
587615
array $values
588-
) : static {
616+
) : static
617+
{
589618
return $this->addWhere($glue, $column, $operator, $values, 'having');
590619
}
591620

src/Manipulation/Traits/Join.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ trait Join
3737
public function from(
3838
array | Closure | string $reference,
3939
array | Closure | string ...$references
40-
) : static {
40+
) : static
41+
{
4142
$this->sql['from'] = [];
4243
foreach ([$reference, ...$references] as $reference) {
4344
$this->sql['from'][] = $reference;
@@ -101,7 +102,8 @@ public function join(
101102
string $type = '',
102103
string $clause = null,
103104
array | Closure $conditional = null
104-
) : static {
105+
) : static
106+
{
105107
return $this->setJoin($table, $type, $clause, $conditional);
106108
}
107109

@@ -364,7 +366,8 @@ private function setJoin(
364366
string $type,
365367
string $clause = null,
366368
Closure | array $expression = null
367-
) : static {
369+
) : static
370+
{
368371
$this->sql['join'] = [
369372
'type' => $type,
370373
'table' => $table,

src/Manipulation/Traits/Values.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ trait Values
3030
public function values(
3131
array | Closure | float | int | string | null $value,
3232
Closure | float | int | string | null ...$values
33-
) : static {
33+
) : static
34+
{
3435
if ( ! \is_array($value)) {
3536
$this->sql['values'][] = [$value, ...$values];
3637
return $this;

0 commit comments

Comments
 (0)