Skip to content

Commit 3572d96

Browse files
committed
feat: support php 8.4 by removing deprecation notices
1 parent 8eb7a37 commit 3572d96

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+112
-101
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: true
1616
matrix:
17-
php: [8.2, 8.3]
17+
php: [8.2, 8.3, 8.4]
1818
laravel: [11]
1919

2020
steps:

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. This projec
55

66
## Unreleased
77

8+
### Changed
9+
10+
- Removed PHP 8.4 deprecation notices.
11+
812
## [7.0.0] - 2024-03-14
913

1014
### Changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"require": {
2525
"php": "^8.2",
2626
"ext-json": "*",
27-
"laravel-json-api/neomerx-json-api": "^5.0.2",
27+
"laravel-json-api/neomerx-json-api": "^5.0.3",
2828
"laravel/framework": "^11.0",
2929
"nyholm/psr7": "^1.8",
3030
"ramsey/uuid": "^4.0",

src/Api/Repository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function exists($apiName)
7272
* route parameters, if needed.
7373
* @return Api
7474
*/
75-
public function createApi(string $apiName, string $host = null, array $parameters = [])
75+
public function createApi(string $apiName, ?string $host = null, array $parameters = [])
7676
{
7777
$config = $this->configFor($apiName);
7878
$config = $this->normalize($config, $host);

src/Broadcasting/BroadcastsData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ protected function broadcastEncoder()
5151
* @param array|null $fieldsets
5252
* @return array
5353
*/
54-
protected function serializeData($data, $includePaths = null, array $fieldsets = null)
54+
protected function serializeData($data, $includePaths = null, ?array $fieldsets = null)
5555
{
5656
$params = new QueryParameters($includePaths ? (array) $includePaths : null, $fieldsets);
5757

src/Client/AbstractClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ abstract class AbstractClient implements ClientInterface
7272
abstract protected function request(
7373
$method,
7474
$uri,
75-
array $payload = null,
75+
?array $payload = null,
7676
array $parameters = []
7777
);
7878

src/Client/GuzzleClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function __construct(
6060
protected function request(
6161
$method,
6262
$uri,
63-
array $payload = null,
63+
?array $payload = null,
6464
array $parameters = []
6565
) {
6666
$request = new Request($method, $uri);

src/Codec/Encoding.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class Encoding
5454
public static function create(
5555
$mediaType,
5656
int $options = 0,
57-
string $urlPrefix = null,
57+
?string $urlPrefix = null,
5858
int $depth = 512
5959
): self
6060
{
@@ -73,7 +73,7 @@ public static function create(
7373
* @param int $depth
7474
* @return Encoding
7575
*/
76-
public static function jsonApi(int $options = 0, string $urlPrefix = null, int $depth = 512): self
76+
public static function jsonApi(int $options = 0, ?string $urlPrefix = null, int $depth = 512): self
7777
{
7878
return self::create(
7979
MediaTypeInterface::JSON_API_MEDIA_TYPE,
@@ -104,7 +104,7 @@ public static function custom($mediaType): self
104104
* @param string|null $urlPrefix
105105
* @return Encoding
106106
*/
107-
public static function fromArray($key, $value, string $urlPrefix = null): self
107+
public static function fromArray($key, $value, ?string $urlPrefix = null): self
108108
{
109109
if (is_numeric($key)) {
110110
$key = $value;

src/Codec/EncodingList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class EncodingList implements IteratorAggregate, Countable
4747
* @param string|null $urlPrefix
4848
* @return EncodingList
4949
*/
50-
public static function fromArray(iterable $config, string $urlPrefix = null): self
50+
public static function fromArray(iterable $config, ?string $urlPrefix = null): self
5151
{
5252
$values = Collection::make($config)
5353
->map(fn($value, $key) => Encoding::fromArray($key, $value, $urlPrefix))

src/Container.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ protected function getCreatedAdapter($resourceType)
379379
* @param ResourceAdapterInterface|null $adapter
380380
* @return void
381381
*/
382-
protected function setCreatedAdapter($resourceType, ResourceAdapterInterface $adapter = null)
382+
protected function setCreatedAdapter($resourceType, ?ResourceAdapterInterface $adapter = null)
383383
{
384384
$this->createdAdapters[$resourceType] = $adapter;
385385
}
@@ -467,7 +467,7 @@ protected function getCreatedAuthorizer($resourceType)
467467
* @param AuthorizerInterface|null $authorizer
468468
* @return void
469469
*/
470-
protected function setCreatedAuthorizer($resourceType, AuthorizerInterface $authorizer = null)
470+
protected function setCreatedAuthorizer($resourceType, ?AuthorizerInterface $authorizer = null)
471471
{
472472
$this->createdAuthorizers[$resourceType] = $authorizer;
473473
}

0 commit comments

Comments
 (0)