Skip to content

Commit

Permalink
Added support for PHP 8.4. Fixed deprecation notices on implicity nul…
Browse files Browse the repository at this point in the history
…l in ServiceManagerFactory.php and CorsService.php

Signed-off-by: Eric Richer [email protected] <[email protected]>
  • Loading branch information
visto9259 committed Nov 23, 2024
1 parent 2bc6d47 commit d3c78ea
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 56 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
103 changes: 51 additions & 52 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Service/CorsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) ?: []);
Expand Down
2 changes: 1 addition & 1 deletion tests/Util/ServiceManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit d3c78ea

Please sign in to comment.