Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support PHP 8.4 #68

Merged
merged 2 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
name: "PHP: ${{ matrix.php }}; Laravel: ${{ matrix.laravel }}; Prefer: ${{ matrix.prefer }}"
strategy:
matrix:
php: ['8.1', '8.2', '8.3']
php: ['8.1', '8.2', '8.3', '8.4']
laravel: [^9.0, ^10.0, ^11.0]
prefer: [prefer-lowest, prefer-stable]
include:
Expand Down Expand Up @@ -127,6 +127,10 @@ jobs:
if: ${{ matrix.php == 8.3 && matrix.prefer == 'prefer-lowest' }}
run: composer require --no-update nesbot/carbon:"^2.62.1"

- name: Support prefer-lowest in PHP 8.4
if: ${{ matrix.php == 8.4 && matrix.prefer == 'prefer-lowest' }}
run: composer require --no-update nesbot/carbon:"^2.62.1"

- name: Install dependencies
run: composer update --${{ matrix.prefer }}

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ A lightweight API resource for Laravel that helps you adhere to the `JSON:API` s

## Version support

- **PHP**: `8.1`, `8.2`, `8.3`
- **PHP**: `8.1`, `8.2`, `8.3`, `8.4`
- **Laravel**: `9.0`, `10.0`, `11.0`

## Installation
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,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",
"illuminate/collections": "^9.0 || ^10.0 || ^11.0",
"illuminate/database": "^9.0 || ^10.0 || ^11.0",
"illuminate/http": "^9.0 || ^10.0 || ^11.0",
Expand Down
1 change: 0 additions & 1 deletion src/Support/Fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace TiMacDonald\JsonApi\Support;

use Illuminate\Http\Request;

use Symfony\Component\HttpKernel\Exception\HttpException;
use WeakMap;

Expand Down
165 changes: 101 additions & 64 deletions tests/Feature/JsonApiTest.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class TestCase extends BaseTestCase
{
public const JSON_API_SCHEMA_URL = 'http://jsonapi.org/schema';
public const JSON_API_SCHEMA_URL = 'https://raw.githubusercontent.com/json-api/json-api/refs/heads/gh-pages/_schemas/1.0/schema.json';

public function setUp(): void
{
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/AttributesAsPropertiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ public function toAttributes($request)
public function testItDoesntTryToAccessMagicAttributeProperty()
{
$instance = new class () extends Model {
protected $table = 'model';

public function getAttributesAttribute()
{
throw new Exception('xxxx');
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/RelationshipsAsPropertiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ public function toRelationships($request)
public function testItDoesntTryToAccessMagicAttributeProperty()
{
$instance = new class () extends Model {
protected $table = 'model';

public function getRelationshipsAttribute()
{
throw new Exception('xxxx');
Expand Down