From 0e95e6d09dcb9b4e28283cef17147764c8106069 Mon Sep 17 00:00:00 2001 From: Rajesh Kumar Date: Thu, 1 Feb 2024 13:00:51 +0530 Subject: [PATCH] PHP 8.3 support --- src/Adapter/Platform/Sql92.php | 2 +- test/unit/Adapter/Driver/IbmDb2/StatementTest.php | 1 + test/unit/RowGateway/RowGatewayTest.php | 1 + test/unit/Sql/Platform/Mysql/SelectDecoratorTest.php | 1 + test/unit/TableGateway/AbstractTableGatewayTest.php | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Adapter/Platform/Sql92.php b/src/Adapter/Platform/Sql92.php index df027429..05965647 100644 --- a/src/Adapter/Platform/Sql92.php +++ b/src/Adapter/Platform/Sql92.php @@ -24,6 +24,6 @@ public function quoteValue($value) 'Attempting to quote a value without specific driver level support' . ' can introduce security vulnerabilities in a production environment.' ); - return '\'' . addcslashes($value, "\x00\n\r\\'\"\x1a") . '\''; + return '\'' . addcslashes(isset($value) ? $value : '', "\x00\n\r\\'\"\x1a") . '\''; } } diff --git a/test/unit/Adapter/Driver/IbmDb2/StatementTest.php b/test/unit/Adapter/Driver/IbmDb2/StatementTest.php index e386d793..4119a317 100644 --- a/test/unit/Adapter/Driver/IbmDb2/StatementTest.php +++ b/test/unit/Adapter/Driver/IbmDb2/StatementTest.php @@ -12,6 +12,7 @@ include __DIR__ . '/TestAsset/Db2Functions.php'; +#[\AllowDynamicProperties] class StatementTest extends TestCase { /** @var Statement */ diff --git a/test/unit/RowGateway/RowGatewayTest.php b/test/unit/RowGateway/RowGatewayTest.php index 87229a81..0efb015e 100644 --- a/test/unit/RowGateway/RowGatewayTest.php +++ b/test/unit/RowGateway/RowGatewayTest.php @@ -12,6 +12,7 @@ use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +#[\AllowDynamicProperties] class RowGatewayTest extends TestCase { /** @var Adapter&MockObject */ diff --git a/test/unit/Sql/Platform/Mysql/SelectDecoratorTest.php b/test/unit/Sql/Platform/Mysql/SelectDecoratorTest.php index b852f783..ca10a43e 100644 --- a/test/unit/Sql/Platform/Mysql/SelectDecoratorTest.php +++ b/test/unit/Sql/Platform/Mysql/SelectDecoratorTest.php @@ -17,6 +17,7 @@ use LaminasTest\Db\TestAsset\TrustingMysqlPlatform; use PHPUnit\Framework\TestCase; +#[\AllowDynamicProperties] class SelectDecoratorTest extends TestCase { /** diff --git a/test/unit/TableGateway/AbstractTableGatewayTest.php b/test/unit/TableGateway/AbstractTableGatewayTest.php index ab50b223..eeb6e740 100644 --- a/test/unit/TableGateway/AbstractTableGatewayTest.php +++ b/test/unit/TableGateway/AbstractTableGatewayTest.php @@ -19,6 +19,7 @@ use PHPUnit\Framework\TestCase; use ReflectionClass; +#[\AllowDynamicProperties] class AbstractTableGatewayTest extends TestCase { /** @var Generator */