Skip to content

Commit a609759

Browse files
committed
PHP: deprecated fixes for v8.5
1 parent ffcc739 commit a609759

3 files changed

Lines changed: 4 additions & 16 deletions

File tree

phpstan.neon

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,6 @@ parameters:
8080
count: 2
8181
path: src/Fluent/Condition.php
8282

83-
-
84-
rawMessage: 'Array key must be integer or string, but string|null given.'
85-
identifier: shipmonk.unsafeArrayKey
86-
count: 3
87-
path: src/Fluent/Query.php
88-
8983
-
9084
rawMessage: Overwriting variable $column while changing its type from bool to string
9185
identifier: shipmonk.variableTypeOverwritten
@@ -304,12 +298,6 @@ parameters:
304298
count: 3
305299
path: tests/Integration/FetchMutatorTest.php
306300

307-
-
308-
rawMessage: 'Array key must be integer or string, but null given.'
309-
identifier: shipmonk.unsafeArrayKey
310-
count: 1
311-
path: tests/Integration/FetchTest.php
312-
313301
-
314302
rawMessage: Cannot assign offset 1 to Forrest79\PhPgSql\Db\Row.
315303
identifier: offsetAssign.dimType

src/Fluent/Query.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -504,11 +504,11 @@ public function havingOr(array $conditions = []): Condition
504504
private function getConditionParam(string $param, string|null $alias = null): Condition
505505
{
506506
if ($param === self::PARAM_ON_CONDITIONS) {
507-
if (!isset($this->params[$param][$alias])) {
508-
$this->params[$param][$alias] = Condition::createAnd();
507+
if (!isset($this->params[$param][$alias ?? ''])) {
508+
$this->params[$param][$alias ?? ''] = Condition::createAnd();
509509
}
510510

511-
return $this->params[$param][$alias];
511+
return $this->params[$param][$alias ?? ''];
512512
} else if (($param === self::PARAM_WHERE) || ($param === self::PARAM_HAVING)) {
513513
if ($this->params[$param] === null) {
514514
$this->params[$param] = Condition::createAnd();

tests/Integration/FetchTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ public function testFetchAssocObjectAsNull(): void
332332
$row = $result->fetchAssoc('test_column=id');
333333

334334
Tester\Assert::same('', \key($row));
335-
Tester\Assert::same(1, $row[null]);
335+
Tester\Assert::same(1, $row['']);
336336

337337
$result->free();
338338
}

0 commit comments

Comments
 (0)