Skip to content

Commit 6ef45a5

Browse files
committed
[fix] Implicitly nullable parameter declarations for PHP8.4 #1130
1 parent 7775795 commit 6ef45a5

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

.php-cs-fixer.dist.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
->setRules([
66
'@PSR2' => true,
77
'@PSR12' => true,
8-
'array_syntax' => ['syntax' => 'short']
8+
'array_syntax' => ['syntax' => 'short'],
9+
'nullable_type_declaration_for_default_null_value' => true
910
])
1011
->setFinder(
1112
PhpCsFixer\Finder::create()

src/Medoo.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,21 +184,21 @@ class Medoo
184184

185185
/**
186186
* Regular expression pattern for valid table names.
187-
*
187+
*
188188
* @var string
189189
*/
190190
protected const TABLE_PATTERN = "[\p{L}_][\p{L}\p{N}@$#\-_]*";
191191

192192
/**
193193
* Regular expression pattern for valid column names.
194-
*
194+
*
195195
* @var string
196196
*/
197197
protected const COLUMN_PATTERN = "[\p{L}_][\p{L}\p{N}@$#\-_\.]*";
198-
198+
199199
/**
200200
* Regular expression pattern for valid alias names.
201-
*
201+
*
202202
* @var string
203203
*/
204204
protected const ALIAS_PATTERN = "[\p{L}_][\p{L}\p{N}@$#\-_]*";
@@ -541,7 +541,7 @@ public function query(string $statement, array $map = []): ?PDOStatement
541541
* @codeCoverageIgnore
542542
* @return \PDOStatement|null
543543
*/
544-
public function exec(string $statement, array $map = [], callable $callback = null): ?PDOStatement
544+
public function exec(string $statement, array $map = [], ?callable $callback = null): ?PDOStatement
545545
{
546546
$this->statement = null;
547547
$this->errorInfo = null;
@@ -1425,7 +1425,7 @@ protected function dataMap(
14251425
array $columnMap,
14261426
array &$stack,
14271427
bool $root,
1428-
array &$result = null
1428+
?array &$result = null
14291429
): void {
14301430
if ($root) {
14311431
$columnsKey = array_keys($columns);
@@ -1697,7 +1697,7 @@ public function select(string $table, $join, $columns = null, $where = null): ?a
16971697
* @param string $primaryKey
16981698
* @return \PDOStatement|null
16991699
*/
1700-
public function insert(string $table, array $values, string $primaryKey = null): ?PDOStatement
1700+
public function insert(string $table, array $values, ?string $primaryKey = null): ?PDOStatement
17011701
{
17021702
$stack = [];
17031703
$columns = [];
@@ -2160,7 +2160,7 @@ public function action(callable $actions): void
21602160
* @codeCoverageIgnore
21612161
* @return string|null
21622162
*/
2163-
public function id(string $name = null): ?string
2163+
public function id(?string $name = null): ?string
21642164
{
21652165
$type = $this->type;
21662166

0 commit comments

Comments
 (0)