From 07e80965a49f5fb61d4c865e32c13b366f403109 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 21 Jun 2022 14:58:38 +0930 Subject: [PATCH] Fix deprecation notice on PHP 8.1 --- CHANGELOG.md | 1 + src/JsonApi.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df7238d..6cb266c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.2.0] - 2022-06-21 ### Fixed - Fix `EloquentAdapter::filterByIds()` getting key name from query model instead of adapter model +- Fix deprecation notice on PHP 8.1 ## [0.2.0-beta.6] - 2022-04-22 ### Changed diff --git a/src/JsonApi.php b/src/JsonApi.php index d2dc882..9dfac45 100644 --- a/src/JsonApi.php +++ b/src/JsonApi.php @@ -315,7 +315,7 @@ final class JsonApi implements RequestHandlerInterface */ public function stripBasePath(string $path): string { - $basePath = parse_url($this->basePath, PHP_URL_PATH); + $basePath = parse_url($this->basePath, PHP_URL_PATH) ?: ''; $len = strlen($basePath);