Skip to content

Commit 679bb0c

Browse files
committed
Merge branch 'development'
2 parents 8678949 + 164f206 commit 679bb0c

30 files changed

+208
-208
lines changed

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": "^2.1",
43+
"aplus/coding-standard": "^2.8",
4444
"ergebnis/composer-normalize": "^2.25",
4545
"jetbrains/phpstorm-attributes": "^1.0",
4646
"phpmd/phpmd": "^2.13",

src/Database.php

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ public function __construct(
8989
#[SensitiveParameter]
9090
array | string $username,
9191
#[SensitiveParameter]
92-
string $password = null,
93-
string $schema = null,
92+
?string $password = null,
93+
?string $schema = null,
9494
string $host = 'localhost',
9595
int $port = 3306,
96-
Logger $logger = null,
97-
DatabaseCollector $collector = null
96+
?Logger $logger = null,
97+
?DatabaseCollector $collector = null
9898
) {
9999
if ($collector) {
100100
$this->setDebugCollector($collector);
@@ -187,8 +187,8 @@ protected function connect(
187187
#[SensitiveParameter]
188188
array | string $username,
189189
#[SensitiveParameter]
190-
string $password = null,
191-
string $schema = null,
190+
?string $password = null,
191+
?string $schema = null,
192192
string $host = 'localhost',
193193
int $port = 3306
194194
) : static {
@@ -415,7 +415,7 @@ public function use(string $schema) : static
415415
*
416416
* @return CreateSchema
417417
*/
418-
public function createSchema(string $schemaName = null) : CreateSchema
418+
public function createSchema(?string $schemaName = null) : CreateSchema
419419
{
420420
$instance = new CreateSchema($this);
421421
if ($schemaName !== null) {
@@ -431,7 +431,7 @@ public function createSchema(string $schemaName = null) : CreateSchema
431431
*
432432
* @return DropSchema
433433
*/
434-
public function dropSchema(string $schemaName = null) : DropSchema
434+
public function dropSchema(?string $schemaName = null) : DropSchema
435435
{
436436
$instance = new DropSchema($this);
437437
if ($schemaName !== null) {
@@ -447,7 +447,7 @@ public function dropSchema(string $schemaName = null) : DropSchema
447447
*
448448
* @return AlterSchema
449449
*/
450-
public function alterSchema(string $schemaName = null) : AlterSchema
450+
public function alterSchema(?string $schemaName = null) : AlterSchema
451451
{
452452
$instance = new AlterSchema($this);
453453
if ($schemaName !== null) {
@@ -463,7 +463,7 @@ public function alterSchema(string $schemaName = null) : AlterSchema
463463
*
464464
* @return CreateTable
465465
*/
466-
public function createTable(string $tableName = null) : CreateTable
466+
public function createTable(?string $tableName = null) : CreateTable
467467
{
468468
$instance = new CreateTable($this);
469469
if ($tableName !== null) {
@@ -480,7 +480,7 @@ public function createTable(string $tableName = null) : CreateTable
480480
*
481481
* @return DropTable
482482
*/
483-
public function dropTable(string $table = null, string ...$tables) : DropTable
483+
public function dropTable(?string $table = null, string ...$tables) : DropTable
484484
{
485485
$instance = new DropTable($this);
486486
if ($table !== null) {
@@ -496,7 +496,7 @@ public function dropTable(string $table = null, string ...$tables) : DropTable
496496
*
497497
* @return AlterTable
498498
*/
499-
public function alterTable(string $tableName = null) : AlterTable
499+
public function alterTable(?string $tableName = null) : AlterTable
500500
{
501501
$instance = new AlterTable($this);
502502
if ($tableName !== null) {
@@ -508,14 +508,14 @@ public function alterTable(string $tableName = null) : AlterTable
508508
/**
509509
* Call a DELETE statement.
510510
*
511-
* @param array<string,Closure|string>|Closure|string|null $reference
512-
* @param array<string,Closure|string>|Closure|string ...$references
511+
* @param Closure|array<string,Closure|string>|string|null $reference
512+
* @param Closure|array<string,Closure|string>|string ...$references
513513
*
514514
* @return Delete
515515
*/
516516
public function delete(
517-
array | Closure | string $reference = null,
518-
array | Closure | string ...$references
517+
Closure | array | string | null $reference = null,
518+
Closure | array | string ...$references
519519
) : Delete {
520520
$instance = new Delete($this);
521521
if ($reference !== null) {
@@ -531,7 +531,7 @@ public function delete(
531531
*
532532
* @return Insert
533533
*/
534-
public function insert(string $intoTable = null) : Insert
534+
public function insert(?string $intoTable = null) : Insert
535535
{
536536
$instance = new Insert($this);
537537
if ($intoTable !== null) {
@@ -547,7 +547,7 @@ public function insert(string $intoTable = null) : Insert
547547
*
548548
* @return LoadData
549549
*/
550-
public function loadData(string $intoTable = null) : LoadData
550+
public function loadData(?string $intoTable = null) : LoadData
551551
{
552552
$instance = new LoadData($this);
553553
if ($intoTable !== null) {
@@ -563,7 +563,7 @@ public function loadData(string $intoTable = null) : LoadData
563563
*
564564
* @return Replace
565565
*/
566-
public function replace(string $intoTable = null) : Replace
566+
public function replace(?string $intoTable = null) : Replace
567567
{
568568
$instance = new Replace($this);
569569
if ($intoTable !== null) {
@@ -575,14 +575,14 @@ public function replace(string $intoTable = null) : Replace
575575
/**
576576
* Call a SELECT statement.
577577
*
578-
* @param array<string,Closure|string>|Closure|string|null $reference
579-
* @param array<string,Closure|string>|Closure|string ...$references
578+
* @param Closure|array<string,Closure|string>|string|null $reference
579+
* @param Closure|array<string,Closure|string>|string ...$references
580580
*
581581
* @return Select
582582
*/
583583
public function select(
584-
array | Closure | string $reference = null,
585-
array | Closure | string ...$references
584+
Closure | array | string | null $reference = null,
585+
Closure | array | string ...$references
586586
) : Select {
587587
$instance = new Select($this);
588588
if ($reference !== null) {
@@ -594,14 +594,14 @@ public function select(
594594
/**
595595
* Call a UPDATE statement.
596596
*
597-
* @param array<string,Closure|string>|Closure|string|null $reference
598-
* @param array<string,Closure|string>|Closure|string ...$references
597+
* @param Closure|array<string,Closure|string>|string|null $reference
598+
* @param Closure|array<string,Closure|string>|string ...$references
599599
*
600600
* @return Update
601601
*/
602602
public function update(
603-
array | Closure | string $reference = null,
604-
array | Closure | string ...$references
603+
Closure | array | string | null $reference = null,
604+
Closure | array | string ...$references
605605
) : Update {
606606
$instance = new Update($this);
607607
if ($reference !== null) {
@@ -773,7 +773,7 @@ public function protectIdentifier(string $identifier) : string
773773
* the word "NULL". If is false, "FALSE". If is true, "TRUE". If is a string,
774774
* returns the quoted string. The types int or float returns the same input value.
775775
*/
776-
public function quote(float | bool | int | string | null $value) : float | int | string
776+
public function quote(bool | float | int | string | null $value) : float | int | string
777777
{
778778
$type = \gettype($value);
779779
if ($type === 'string') {
@@ -818,7 +818,7 @@ protected function addToDebug(Closure $function) : mixed
818818

819819
protected function finalizeAddToDebug(
820820
float $start,
821-
string|null $description = null
821+
?string $description = null
822822
) : void {
823823
$end = \microtime(true);
824824
$rows = $this->mysqli->affected_rows;

src/Definition/AlterSchema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public function sql() : string
143143
*
144144
* @return int|string The number of affected rows
145145
*/
146-
public function run() : int|string
146+
public function run() : int | string
147147
{
148148
return $this->database->exec($this->sql());
149149
}

src/Definition/AlterTable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ protected function renderRenameKeys() : ?string
498498
return \implode(',' . \PHP_EOL, $renames);
499499
}
500500

501-
public function convertToCharset(string $charset, string $collation = null) : static
501+
public function convertToCharset(string $charset, ?string $collation = null) : static
502502
{
503503
$this->sql['convert_to_charset'] = [
504504
'charset' => $charset,

src/Definition/CreateSchema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function sql() : string
140140
*
141141
* @return int|string The number of affected rows
142142
*/
143-
public function run() : int|string
143+
public function run() : int | string
144144
{
145145
return $this->database->exec($this->sql());
146146
}

src/Definition/CreateTable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function sql() : string
137137
*
138138
* @return int|string The number of affected rows
139139
*/
140-
public function run() : int|string
140+
public function run() : int | string
141141
{
142142
return $this->database->exec($this->sql());
143143
}

src/Definition/DropSchema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function sql() : string
6969
*
7070
* @return int|string The number of affected rows
7171
*/
72-
public function run() : int|string
72+
public function run() : int | string
7373
{
7474
return $this->database->exec($this->sql());
7575
}

src/Definition/DropTable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function sql() : string
144144
*
145145
* @return int|string The number of affected rows
146146
*/
147-
public function run() : int|string
147+
public function run() : int | string
148148
{
149149
return $this->database->exec($this->sql());
150150
}

src/Definition/Table/Columns/Column.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ abstract class Column extends DefinitionPart
3030
protected bool $null = false;
3131
protected bool $uniqueKey = false;
3232
protected bool $primaryKey = false;
33-
protected bool | Closure | float | int | string | null $default;
33+
protected Closure | bool | float | int | string | null $default;
3434
protected Closure $check;
3535
protected ?string $comment;
3636
protected bool $first = false;
@@ -108,11 +108,11 @@ protected function renderNull() : ?string
108108
}
109109

110110
/**
111-
* @param bool|Closure|float|int|string|null $default
111+
* @param Closure|bool|float|int|string|null $default
112112
*
113113
* @return static
114114
*/
115-
public function default(bool | Closure | float | int | string | null $default) : static
115+
public function default(Closure | bool | float | int | string | null $default) : static
116116
{
117117
$this->default = $default;
118118
return $this;

src/Definition/Table/Columns/ColumnDefinition.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,52 +66,52 @@ public function __construct(Database $database)
6666
$this->database = $database;
6767
}
6868

69-
public function int(int $maximum = null) : IntColumn
69+
public function int(?int $maximum = null) : IntColumn
7070
{
7171
return $this->column = new IntColumn($this->database, $maximum);
7272
}
7373

74-
public function bigint(int $maximum = null) : BigintColumn
74+
public function bigint(?int $maximum = null) : BigintColumn
7575
{
7676
return $this->column = new BigintColumn($this->database, $maximum);
7777
}
7878

79-
public function tinyint(int $maximum = null) : TinyintColumn
79+
public function tinyint(?int $maximum = null) : TinyintColumn
8080
{
8181
return $this->column = new TinyintColumn($this->database, $maximum);
8282
}
8383

84-
public function decimal(int $maximum = null, int $decimals = null) : DecimalColumn
84+
public function decimal(?int $maximum = null, ?int $decimals = null) : DecimalColumn
8585
{
8686
return $this->column = new DecimalColumn($this->database, $maximum, $decimals);
8787
}
8888

89-
public function float(int $maximum = null, int $decimals = null) : FloatColumn
89+
public function float(?int $maximum = null, ?int $decimals = null) : FloatColumn
9090
{
9191
return $this->column = new FloatColumn($this->database, $maximum, $decimals);
9292
}
9393

94-
public function mediumint(int $maximum = null) : MediumintColumn
94+
public function mediumint(?int $maximum = null) : MediumintColumn
9595
{
9696
return $this->column = new MediumintColumn($this->database, $maximum);
9797
}
9898

99-
public function smallint(int $maximum = null) : SmallintColumn
99+
public function smallint(?int $maximum = null) : SmallintColumn
100100
{
101101
return $this->column = new SmallintColumn($this->database, $maximum);
102102
}
103103

104-
public function boolean(int $maximum = null) : BooleanColumn
104+
public function boolean(?int $maximum = null) : BooleanColumn
105105
{
106106
return $this->column = new BooleanColumn($this->database, $maximum);
107107
}
108108

109-
public function varchar(int $maximum = null) : VarcharColumn
109+
public function varchar(?int $maximum = null) : VarcharColumn
110110
{
111111
return $this->column = new VarcharColumn($this->database, $maximum);
112112
}
113113

114-
public function char(int $maximum = null) : CharColumn
114+
public function char(?int $maximum = null) : CharColumn
115115
{
116116
return $this->column = new CharColumn($this->database, $maximum);
117117
}
@@ -126,7 +126,7 @@ public function set(string $value, string ...$values) : SetColumn
126126
return $this->column = new SetColumn($this->database, $value, ...$values);
127127
}
128128

129-
public function text(int $maximum = null) : TextColumn
129+
public function text(?int $maximum = null) : TextColumn
130130
{
131131
return $this->column = new TextColumn($this->database, $maximum);
132132
}

src/Definition/Table/Indexes/IndexDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class IndexDefinition extends DefinitionPart
3333
protected ?string $name;
3434
protected ?Index $index = null;
3535

36-
public function __construct(Database $database, string $name = null)
36+
public function __construct(Database $database, ?string $name = null)
3737
{
3838
$this->database = $database;
3939
$this->name = $name;

0 commit comments

Comments
 (0)