From ca02167f707dd8b7fc3c93e083e58bba28dcb6e9 Mon Sep 17 00:00:00 2001 From: "Eric Richer eric.richer@vistoconsulting.com" Date: Sat, 23 Nov 2024 13:56:58 -0500 Subject: [PATCH] Added support for PHP 8.4. Fixed deprecation notices on implicity null in ServiceManagerFactory.php and CorsService.php Signed-off-by: Eric Richer eric.richer@vistoconsulting.com --- composer.json | 2 +- composer.lock | 103 +++++++++++++-------------- src/Service/CorsService.php | 4 +- tests/Util/ServiceManagerFactory.php | 2 +- 4 files changed, 55 insertions(+), 56 deletions(-) diff --git a/composer.json b/composer.json index c8f3bfe..4645e7b 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ } }, "require": { - "php": "~8.1.0 || ~8.2.0 || ~8.3.0", + "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", "laminas/laminas-eventmanager": "^2.6.4 || ^3.2.1", "laminas/laminas-http": "^2.10", "laminas/laminas-mvc": "^2.7.15 || ^3.1.1", diff --git a/composer.lock b/composer.lock index ed1a64a..36ccc95 100644 --- a/composer.lock +++ b/composer.lock @@ -57,22 +57,22 @@ }, { "name": "laminas/laminas-config", - "version": "3.10.0", + "version": "3.9.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-config.git", - "reference": "b79e7dbd01889e4574526cf8d2b18f9d5b18384c" + "reference": "e53717277f6c22b1c697a46473b9a5ec9a438efa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-config/zipball/b79e7dbd01889e4574526cf8d2b18f9d5b18384c", - "reference": "b79e7dbd01889e4574526cf8d2b18f9d5b18384c", + "url": "https://api.github.com/repos/laminas/laminas-config/zipball/e53717277f6c22b1c697a46473b9a5ec9a438efa", + "reference": "e53717277f6c22b1c697a46473b9a5ec9a438efa", "shasum": "" }, "require": { "ext-json": "*", "laminas/laminas-stdlib": "^3.6", - "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0", "psr/container": "^1.0" }, "conflict": { @@ -80,11 +80,11 @@ "zendframework/zend-config": "*" }, "require-dev": { - "laminas/laminas-coding-standard": "^3.0.1", - "laminas/laminas-filter": "^2.39.0", - "laminas/laminas-i18n": "^2.29.0", - "laminas/laminas-servicemanager": "^3.23.0", - "phpunit/phpunit": "^10.5.38" + "laminas/laminas-coding-standard": "~2.4.0", + "laminas/laminas-filter": "~2.23.0", + "laminas/laminas-i18n": "~2.19.0", + "laminas/laminas-servicemanager": "~3.19.0", + "phpunit/phpunit": "~9.5.25" }, "suggest": { "laminas/laminas-filter": "^2.7.2; install if you want to use the Filter processor", @@ -121,7 +121,7 @@ "type": "community_bridge" } ], - "time": "2024-11-17T22:10:53+00:00" + "time": "2023-09-19T12:02:54+00:00" }, { "name": "laminas/laminas-escaper", @@ -437,16 +437,16 @@ }, { "name": "laminas/laminas-modulemanager", - "version": "2.17.0", + "version": "2.16.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-modulemanager.git", - "reference": "3cd6e84ba767b43a47c6c4245a56b30ac3738c6a" + "reference": "8df7b237d75c04a1bc17b8f7d01eeb601cd7b7e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-modulemanager/zipball/3cd6e84ba767b43a47c6c4245a56b30ac3738c6a", - "reference": "3cd6e84ba767b43a47c6c4245a56b30ac3738c6a", + "url": "https://api.github.com/repos/laminas/laminas-modulemanager/zipball/8df7b237d75c04a1bc17b8f7d01eeb601cd7b7e3", + "reference": "8df7b237d75c04a1bc17b8f7d01eeb601cd7b7e3", "shasum": "" }, "require": { @@ -454,21 +454,20 @@ "laminas/laminas-config": "^3.7", "laminas/laminas-eventmanager": "^3.4", "laminas/laminas-stdlib": "^3.6", - "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", + "php": "~8.1.0 || ~8.2.0|| ~8.3.0", "webimpress/safe-writer": "^1.0.2 || ^2.1" }, "conflict": { - "amphp/amp": "<2.6.4", "zendframework/zend-modulemanager": "*" }, "require-dev": { - "laminas/laminas-coding-standard": "^3.0.1", - "laminas/laminas-loader": "^2.11", - "laminas/laminas-mvc": "^3.7.0", - "laminas/laminas-servicemanager": "^3.23.0", - "phpunit/phpunit": "^10.5.38", + "laminas/laminas-coding-standard": "^2.5", + "laminas/laminas-loader": "^2.10", + "laminas/laminas-mvc": "^3.6.1", + "laminas/laminas-servicemanager": "^3.22.1", + "phpunit/phpunit": "^10.4.2", "psalm/plugin-phpunit": "^0.19.0", - "vimeo/psalm": "^5.26.1" + "vimeo/psalm": "^5.15" }, "suggest": { "laminas/laminas-console": "Laminas\\Console component", @@ -506,7 +505,7 @@ "type": "community_bridge" } ], - "time": "2024-11-17T22:29:29+00:00" + "time": "2024-06-14T14:44:50+00:00" }, { "name": "laminas/laminas-mvc", @@ -1504,16 +1503,16 @@ }, { "name": "composer/pcre", - "version": "3.3.2", + "version": "3.3.1", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" + "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", - "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "url": "https://api.github.com/repos/composer/pcre/zipball/63aaeac21d7e775ff9bc9d45021e1745c97521c4", + "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4", "shasum": "" }, "require": { @@ -1523,8 +1522,8 @@ "phpstan/phpstan": "<1.11.10" }, "require-dev": { - "phpstan/phpstan": "^1.12 || ^2", - "phpstan/phpstan-strict-rules": "^1 || ^2", + "phpstan/phpstan": "^1.11.10", + "phpstan/phpstan-strict-rules": "^1.1", "phpunit/phpunit": "^8 || ^9" }, "type": "library", @@ -1563,7 +1562,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.3.2" + "source": "https://github.com/composer/pcre/tree/3.3.1" }, "funding": [ { @@ -1579,7 +1578,7 @@ "type": "tidelift" } ], - "time": "2024-11-12T16:29:46+00:00" + "time": "2024-08-27T18:44:43+00:00" }, { "name": "composer/semver", @@ -4302,16 +4301,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.11.1", + "version": "3.10.3", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "19473c30efe4f7b3cd42522d0b2e6e7f243c6f87" + "reference": "62d32998e820bddc40f99f8251958aed187a5c9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/19473c30efe4f7b3cd42522d0b2e6e7f243c6f87", - "reference": "19473c30efe4f7b3cd42522d0b2e6e7f243c6f87", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/62d32998e820bddc40f99f8251958aed187a5c9c", + "reference": "62d32998e820bddc40f99f8251958aed187a5c9c", "shasum": "" }, "require": { @@ -4378,20 +4377,20 @@ "type": "open_collective" } ], - "time": "2024-11-16T12:02:36+00:00" + "time": "2024-09-18T10:38:58+00:00" }, { "name": "symfony/console", - "version": "v6.4.15", + "version": "v6.4.14", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd" + "reference": "897c2441ed4eec8a8a2c37b943427d24dba3f26b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/f1fc6f47283e27336e7cebb9e8946c8de7bff9bd", - "reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd", + "url": "https://api.github.com/repos/symfony/console/zipball/897c2441ed4eec8a8a2c37b943427d24dba3f26b", + "reference": "897c2441ed4eec8a8a2c37b943427d24dba3f26b", "shasum": "" }, "require": { @@ -4456,7 +4455,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.15" + "source": "https://github.com/symfony/console/tree/v6.4.14" }, "funding": [ { @@ -4472,7 +4471,7 @@ "type": "tidelift" } ], - "time": "2024-11-06T14:19:14+00:00" + "time": "2024-11-05T15:34:40+00:00" }, { "name": "symfony/deprecation-contracts", @@ -5010,16 +5009,16 @@ }, { "name": "symfony/string", - "version": "v6.4.15", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f" + "reference": "38371c60c71c72b3d64d8d76f6b1bb81a2cc3627" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f", - "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f", + "url": "https://api.github.com/repos/symfony/string/zipball/38371c60c71c72b3d64d8d76f6b1bb81a2cc3627", + "reference": "38371c60c71c72b3d64d8d76f6b1bb81a2cc3627", "shasum": "" }, "require": { @@ -5076,7 +5075,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.4.15" + "source": "https://github.com/symfony/string/tree/v6.4.13" }, "funding": [ { @@ -5092,7 +5091,7 @@ "type": "tidelift" } ], - "time": "2024-11-13T13:31:12+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "theseer/tokenizer", @@ -5370,15 +5369,15 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { "php": "~8.1.0 || ~8.2.0 || ~8.3.0" }, - "platform-dev": {}, + "platform-dev": [], "platform-overrides": { "php": "8.1.99" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" } diff --git a/src/Service/CorsService.php b/src/Service/CorsService.php index 26f0ef3..b0cb36c 100644 --- a/src/Service/CorsService.php +++ b/src/Service/CorsService.php @@ -131,7 +131,7 @@ public function createPreflightCorsResponse(HttpRequest $request): HttpResponse * * @return HttpResponse */ - public function createPreflightCorsResponseWithRouteOptions(HttpRequest $request, RouteMatch $routeMatch = null): HttpResponse + public function createPreflightCorsResponseWithRouteOptions(HttpRequest $request, RouteMatch|null $routeMatch = null): HttpResponse { $options = $this->options; if ($routeMatch instanceof RouteMatch) { @@ -149,7 +149,7 @@ public function createPreflightCorsResponseWithRouteOptions(HttpRequest $request * @return HttpResponse * @throws DisallowedOriginException If the origin is not allowed */ - public function populateCorsResponse(HttpRequest $request, HttpResponse $response, RouteMatch $routeMatch = null): HttpResponse + public function populateCorsResponse(HttpRequest $request, HttpResponse $response, RouteMatch|null $routeMatch = null): HttpResponse { if ($routeMatch instanceof RouteMatch) { $this->options->setFromArray($routeMatch->getParam(CorsOptions::ROUTE_PARAM) ?: []); diff --git a/tests/Util/ServiceManagerFactory.php b/tests/Util/ServiceManagerFactory.php index a5f9146..2de167a 100644 --- a/tests/Util/ServiceManagerFactory.php +++ b/tests/Util/ServiceManagerFactory.php @@ -65,7 +65,7 @@ public static function getApplicationConfig(): array * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ - public static function getServiceManager(array $config = null): ServiceManager + public static function getServiceManager(array|null $config = null): ServiceManager { $config = $config ?: static::getApplicationConfig(); $serviceManager = new ServiceManager();