Skip to content

Commit d983f29

Browse files
committed
Merge branch 'release/4.1.0'
2 parents ed70eb2 + 0365c05 commit d983f29

File tree

7 files changed

+109
-107
lines changed

7 files changed

+109
-107
lines changed

.github/workflows/tests.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,12 @@ jobs:
1414
strategy:
1515
fail-fast: true
1616
matrix:
17-
php: [7.4, '8.0', 8.1]
18-
laravel: [8.76, 9]
19-
exclude:
20-
- php: 7.4
21-
laravel: 9
17+
php: ['8.0', 8.1, 8.2]
18+
laravel: [9]
2219

2320
steps:
2421
- name: Checkout Code
25-
uses: actions/checkout@v2
22+
uses: actions/checkout@v3
2623

2724
- name: Setup PHP
2825
uses: shivammathur/setup-php@v2
@@ -37,7 +34,7 @@ jobs:
3734
run: composer require "laravel/framework:^${{ matrix.laravel }}" --no-update
3835

3936
- name: Install dependencies
40-
uses: nick-invision/retry@v1
37+
uses: nick-fields/retry@v2
4138
with:
4239
timeout_minutes: 5
4340
max_attempts: 5

CHANGELOG.md

Lines changed: 98 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
All notable changes to this project will be documented in this file. This project adheres to
44
[Semantic Versioning](http://semver.org/) and [this changelog format](http://keepachangelog.com/).
55

6+
## [4.1.0] - 2023-01-19
7+
8+
### Changed
9+
10+
- Drop support for PHP `7.4` - minimum PHP version is now `8.0`.
11+
- Drop support for Laravel 8.
12+
- Upgraded `laravel-json-api/neomerx-json-api` dependency to `^1.2`. This allows v1, v2 and v3 of the PSR log
13+
dependency, whereas previously only v1 was allowed.
14+
615
## [4.0.1] - 2022-04-24
716

817
### Fixed
@@ -23,12 +32,12 @@ All notable changes to this project will be documented in this file. This projec
2332
- Package now depends on our fork of the Neomerx JSON:API package - `laravel-json-api/neomerx-json-api`. This is a
2433
non-breaking change.
2534
- **BREAKING** Added return types to internal methods, to remove deprecation notices in PHP 8.1. This will affect your
26-
implementation if you have extended any of our classes and overloaded a method that now has a return type.
35+
implementation if you have extended any of our classes and overloaded a method that now has a return type.
2736

2837
### Removed
2938

30-
- **BREAKING** Removed the following classes from the `CloudCreativity\LaravelJsonApi\Testing` namespace. You must
31-
use classes (with the same names) from the `LaravelJsonApi\Testing` namespace, after installing the
39+
- **BREAKING** Removed the following classes from the `CloudCreativity\LaravelJsonApi\Testing` namespace. You must
40+
use classes (with the same names) from the `LaravelJsonApi\Testing` namespace, after installing the
3241
`laravel-json-api/testing` package as a dev dependency. Refer to the upgrade guide for details. Classes/traits removed
3342
are:
3443
- `MakesJsonApiRequests`
@@ -206,43 +215,43 @@ All notable changes to this project will be documented in this file. This projec
206215
the [documented validation implementation](./docs/basics/validators.md) instead.
207216
- The deprecated `json_api_request()` helper was removed.
208217
- The following methods were removed from the JSON API service (and are therefore no longer available via the facade):
209-
- `request()`: use `currentRoute()` instead.
210-
- `defaultApi()`: set the default API via `LaravelJsonApi::defaultApi()` instead.
218+
- `request()`: use `currentRoute()` instead.
219+
- `defaultApi()`: set the default API via `LaravelJsonApi::defaultApi()` instead.
211220
- All deprecated methods on the `Testing\MakesJsonApiRequests` trait and `Testing\TestResponse` class were removed.
212221
- Removed the `Http\Requests\ValidatedRequest::validate()` method, as Laravel replaced it with
213222
`validateResolved()`. This affects all JSON API request classes.
214223
- Additionally, the following deprecated interfaces, classes and traits were removed:
215-
- `Api\ResourceProvider` - extend `Api\AbstractProvider` instead.
216-
- `Contracts\Document\MutableErrorInterface`
217-
- `Contracts\Exceptions\ErrorIdAllocatorInterface`
218-
- `Contracts\Factories\FactoryInterface`
219-
- `Contracts\Http\Responses\ErrorResponseInterface`
220-
- `Contracts\Object\*` - all interfaces in this namespace.
221-
- `Contracts\Repositories\ErrorRepositoryInterface`
222-
- `Contracts\Utils\ErrorReporterInterface`
223-
- `Contracts\Utils\ErrorsAwareInterface`
224-
- `Contracts\Utils\ReplacerInterface`
225-
- `Document\Error` - use `Document\Error\Error` instead.
226-
- `Eloquent\AbstractSchema` - extend the `neomerx/json-api` schema instead.
227-
- `Eloquent\Concerns\SerializesModels` trait.
228-
- `Exceptions\MutableErrorCollection`
229-
- `Exceptions\NotFoundException`
230-
- `Exceptions\RecordNotFoundException` - use `Exceptions\ResourceNotFoundException` instead.
231-
- `Http\Query\ChecksQueryParameters` trait.
232-
- `Http\Requests\JsonApiRequest`
233-
- `Http\Responses\ErrorResponse`
234-
- `Object\*` - all classes in this namespace.
235-
- `Repositories\ErrorRepository`
236-
- `Schema\AbstractSchema` - extend the `neomerx/json-api` schema instead.
237-
- `Schema\CreatesEloquentIdentities` trait.
238-
- `Schema\CreatesLinks` trait.
239-
- `Schema\EloquentSchema` - extend the `neomerx/json-api` schema instead.
240-
- `Utils\AbstractErrorBag`
241-
- `Utils\ErrorBag`
242-
- `Utils\ErrorCreatorTrait`
243-
- `Utils\ErrorsAwareTrait`
244-
- `Utils\Pointer`
245-
- `Utils\Replacer`
224+
- `Api\ResourceProvider` - extend `Api\AbstractProvider` instead.
225+
- `Contracts\Document\MutableErrorInterface`
226+
- `Contracts\Exceptions\ErrorIdAllocatorInterface`
227+
- `Contracts\Factories\FactoryInterface`
228+
- `Contracts\Http\Responses\ErrorResponseInterface`
229+
- `Contracts\Object\*` - all interfaces in this namespace.
230+
- `Contracts\Repositories\ErrorRepositoryInterface`
231+
- `Contracts\Utils\ErrorReporterInterface`
232+
- `Contracts\Utils\ErrorsAwareInterface`
233+
- `Contracts\Utils\ReplacerInterface`
234+
- `Document\Error` - use `Document\Error\Error` instead.
235+
- `Eloquent\AbstractSchema` - extend the `neomerx/json-api` schema instead.
236+
- `Eloquent\Concerns\SerializesModels` trait.
237+
- `Exceptions\MutableErrorCollection`
238+
- `Exceptions\NotFoundException`
239+
- `Exceptions\RecordNotFoundException` - use `Exceptions\ResourceNotFoundException` instead.
240+
- `Http\Query\ChecksQueryParameters` trait.
241+
- `Http\Requests\JsonApiRequest`
242+
- `Http\Responses\ErrorResponse`
243+
- `Object\*` - all classes in this namespace.
244+
- `Repositories\ErrorRepository`
245+
- `Schema\AbstractSchema` - extend the `neomerx/json-api` schema instead.
246+
- `Schema\CreatesEloquentIdentities` trait.
247+
- `Schema\CreatesLinks` trait.
248+
- `Schema\EloquentSchema` - extend the `neomerx/json-api` schema instead.
249+
- `Utils\AbstractErrorBag`
250+
- `Utils\ErrorBag`
251+
- `Utils\ErrorCreatorTrait`
252+
- `Utils\ErrorsAwareTrait`
253+
- `Utils\Pointer`
254+
- `Utils\Replacer`
246255

247256
## [1.7.0] - 2020-04-13
248257

@@ -450,30 +459,30 @@ $ composer require --dev cloudcreativity/json-api-testing:^2.0
450459

451460
- The following classes in the `Validation` namespace were removed as the `Validation\Validator`
452461
class can be used instead, or validators can be constructed via the factory instead:
453-
- `AbstractValidator`
454-
- `ResourceValidator`
455-
- `QueryValidator`
462+
- `AbstractValidator`
463+
- `ResourceValidator`
464+
- `QueryValidator`
456465
- The deprecated `EloquentController` was removed - extend `JsonApiController` directly.
457466
- The `Store\EloquentAdapter` was removed - extend `Eloquent\AbstractAdapter` directly.
458467
- The following previously deprecated methods/properties were removed from the `EloquentAdapter`:
459-
- public method `queryRelation()`: renamed `queryToMany()`.
460-
- protected property `$with`: renamed `$defaultWith`.
461-
- protected method `keyForAttribute()`: renamed `modelKeyForField()`.
462-
- protected method `columnForField()`: renamed `getSortColumn()`.
463-
- protected method `all()`: renamed `searchAll()`.
464-
- protected method `extractIncludePaths()`: overload the `getQueryParameters()` method instead.
465-
- protected method `extractFilters()`: overload the `getQueryParameters()` method instead.
466-
- protected method `extractPagination()`: overload the `getQueryParameters()` method instead.
468+
- public method `queryRelation()`: renamed `queryToMany()`.
469+
- protected property `$with`: renamed `$defaultWith`.
470+
- protected method `keyForAttribute()`: renamed `modelKeyForField()`.
471+
- protected method `columnForField()`: renamed `getSortColumn()`.
472+
- protected method `all()`: renamed `searchAll()`.
473+
- protected method `extractIncludePaths()`: overload the `getQueryParameters()` method instead.
474+
- protected method `extractFilters()`: overload the `getQueryParameters()` method instead.
475+
- protected method `extractPagination()`: overload the `getQueryParameters()` method instead.
467476
- The previously deprecated `Eloquent\Concerns\AbstractRelation` class was removed.
468477
Extend `Adapter\AbstractRelationshipAdapter` and use the `Eloquent\Concerns\QueriesRelations` trait.
469478
- Removed the deprecated `Contracts\Utils\ConfigurableInterface` as this has not been in use for some time.
470479
- Removed the deprecated `createResourceDocumentValidator()` method from the factory.
471480
- Removed the following previously deprecated methods from the `TestResponse` class:
472-
- `assertJsonApiResponse()`: use `jsonApi()`.
473-
- `normalizeIds()` and `normalizeId()` as these are not in use by the refactored test implementation.
481+
- `assertJsonApiResponse()`: use `jsonApi()`.
482+
- `normalizeIds()` and `normalizeId()` as these are not in use by the refactored test implementation.
474483
- Removed the following previously deprecated methods from the JSON API service/facade:
475-
- `report()`: no longer supported for access via the service.
476-
- `requestOrFail()`: no longer required.
484+
- `report()`: no longer supported for access via the service.
485+
- `requestOrFail()`: no longer required.
477486
- Removed the previously deprecated `Schema\ExtractsAttributesTrait` as it has not been used for some time.
478487

479488
## [1.0.0-beta.6] - 2019-01-03
@@ -543,24 +552,24 @@ $ composer require --dev cloudcreativity/json-api-testing:^2.0
543552
were not in use.
544553
- The previously deprecated `InteractsWithModels` testing trait was removed.
545554
- The following (majority previously deprecated methods) on the `TestResponse` class were removed:
546-
- `assertDocument`
547-
- `assertResourceResponse`
548-
- `assertResourcesResponse`
549-
- `assertRelatedResourcesResponse`
550-
- `assertSearchResponse`
551-
- `assertSearchOneResponse`
552-
- `assertCreateResponse`
553-
- `assertReadResponse`
554-
- `assertUpdateResponse`
555-
- `assertDeleteResponse`
556-
- `assertRelatedResourceResponse`
557-
- `assertHasOneRelationshipResponse`
558-
- `assertDataCollection`
559-
- `assertDataResource`
560-
- `assertDataResourceIdentifier`
561-
- `assertSearchByIdResponse`
562-
- `assertSearchedPolymorphIds`
563-
- `assertReadPolymorphHasMany`
555+
- `assertDocument`
556+
- `assertResourceResponse`
557+
- `assertResourcesResponse`
558+
- `assertRelatedResourcesResponse`
559+
- `assertSearchResponse`
560+
- `assertSearchOneResponse`
561+
- `assertCreateResponse`
562+
- `assertReadResponse`
563+
- `assertUpdateResponse`
564+
- `assertDeleteResponse`
565+
- `assertRelatedResourceResponse`
566+
- `assertHasOneRelationshipResponse`
567+
- `assertDataCollection`
568+
- `assertDataResource`
569+
- `assertDataResourceIdentifier`
570+
- `assertSearchByIdResponse`
571+
- `assertSearchedPolymorphIds`
572+
- `assertReadPolymorphHasMany`
564573

565574
### Deprecated
566575

@@ -607,10 +616,10 @@ $ composer require --dev cloudcreativity/json-api-testing:^2.0
607616
- The `Document\Error` and `Contracts\Document\MutableErrorInterface` are deprecated and will be removed at `2.0`. You
608617
should use the error interface/class from the `neomerx/jsonapi` package instead.
609618
- The following utility classes/traits/interfaces are deprecated and will be removed at `2.0`:
610-
- `Utils/ErrorCreatorTrait`
611-
- `Utils/ErrorsAwareTrait` and `Contracts\Utils\ErrorsAwareInterface`
612-
- `Utils/Pointers`
613-
- `Utils/Replacer` and `Contracts\Utils\ReplacerInterface`
619+
- `Utils/ErrorCreatorTrait`
620+
- `Utils/ErrorsAwareTrait` and `Contracts\Utils\ErrorsAwareInterface`
621+
- `Utils/Pointers`
622+
- `Utils/Replacer` and `Contracts\Utils\ReplacerInterface`
614623
- The `Contracts\Factories\FactoryInterface` is deprecated and will be removed at `1.0`. You should
615624
type-hint `Factories\Factory` directly instead.
616625

@@ -642,10 +651,10 @@ $ composer require --dev cloudcreativity/json-api-testing:^2.0
642651
### Deprecated
643652

644653
- The following methods on the Eloquent adapter will be removed in `1.0.0` as they are no longer required:
645-
- `extractIncludePaths`
646-
- `extractFilters`
647-
- `extractPagination`
648-
- `columnForField`: use `getSortColumn` instead.
654+
- `extractIncludePaths`
655+
- `extractFilters`
656+
- `extractPagination`
657+
- `columnForField`: use `getSortColumn` instead.
649658

650659
## [1.0.0-beta.2] - 2018-08-25
651660

@@ -688,12 +697,12 @@ $ composer require --dev cloudcreativity/json-api-testing:^2.0
688697
### Removed
689698

690699
- The following deprecated methods have been removed from the Eloquent adapter:
691-
- `first`: use `searchOne` instead.
700+
- `first`: use `searchOne` instead.
692701

693702
### Deprecated
694703

695704
- The follow methods are deprecated on the Eloquent adapter and will be removed in `1.0.0`:
696-
- `queryRelation`: use `queryToMany` or `queryToOne` instead.
705+
- `queryRelation`: use `queryToMany` or `queryToOne` instead.
697706

698707
### Fixed
699708

@@ -775,8 +784,8 @@ $ composer require --dev cloudcreativity/json-api-testing:^2.0
775784
- Can now generate authorizers using the `make:json-api:authorizer` command, or the `--auth` flag when generating a
776785
resource with `make:json-api:resource`.
777786
- The JSON API controller now has the following additional hooks:
778-
- `searching` for an *index* action.
779-
- `reading` for a *read* action.
787+
- `searching` for an *index* action.
788+
- `reading` for a *read* action.
780789
- [#163](https://github.com/cloudcreativity/laravel-json-api/issues/163)
781790
Added relationship hooks to the JSON API controller.
782791

@@ -789,20 +798,20 @@ $ composer require --dev cloudcreativity/json-api-testing:^2.0
789798
### Removed
790799

791800
- The previous authorizer implementation has been removed in favour of the new one. The following were deleted:
792-
- `Contract\Authorizer\AuthorizerInterface`
793-
- `Authorizer\AbstractAuthorizer`
794-
- `Authorizer\ReadOnlyAuthorizer`
795-
- `Exceptions\AuthorizationException`
801+
- `Contract\Authorizer\AuthorizerInterface`
802+
- `Authorizer\AbstractAuthorizer`
803+
- `Authorizer\ReadOnlyAuthorizer`
804+
- `Exceptions\AuthorizationException`
796805

797806
### Deprecated
798807

799808
- Eloquent schemas are now deprecated in favour of using generic schemas. This is because of the amount of processing
800809
involved without any benefit, as generic schemas are straight-forward to construct. The following classes/traits are
801810
deprecated:
802-
- `Eloquent\AbstractSchema`
803-
- `Eloquent\SerializesModels`
804-
- `Schema\CreatesLinks`
805-
- `Schema\EloquentSchema` (was deprecated in `1.0.0-alpha.1`).
811+
- `Eloquent\AbstractSchema`
812+
- `Eloquent\SerializesModels`
813+
- `Schema\CreatesLinks`
814+
- `Schema\EloquentSchema` (was deprecated in `1.0.0-alpha.1`).
806815

807816
## [1.0.0-alpha.1] - 2018-04-29
808817

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
}
2323
],
2424
"require": {
25-
"php": "^7.4|^8.0",
25+
"php": "^8.0",
2626
"ext-json": "*",
27-
"laravel-json-api/neomerx-json-api": "^1.1",
28-
"laravel/framework": "^8.76|^9.0",
27+
"laravel-json-api/neomerx-json-api": "^1.2",
28+
"laravel/framework": "^9.0",
2929
"nyholm/psr7": "^1.2",
3030
"ramsey/uuid": "^3.0|^4.0",
3131
"symfony/psr-http-message-bridge": "^2.0"

tests/dummy/database/factories/ModelFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
/** Image */
7171
$factory->define(DummyApp\Image::class, function (Faker $faker) {
7272
return [
73-
'url' => $faker->imageUrl(),
73+
'url' => $faker->url(),
7474
];
7575
});
7676

tests/lib/Integration/ErrorsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public function testCustomInvalidJson()
200200
* whatever error is generated by the application must be returned as a JSON API error
201201
* even if the error has not been generated from one of the configured APIs.
202202
*/
203-
public function testClientWantsJsonApiError()
203+
public function testClientWantsJsonApiError(): void
204204
{
205205
$expected = [
206206
'errors' => [
@@ -218,7 +218,7 @@ public function testClientWantsJsonApiError()
218218
$response
219219
->assertStatus(404)
220220
->assertHeader('Content-Type', 'application/vnd.api+json')
221-
->assertExactJson($expected);
221+
->assertJson($expected);
222222
}
223223

224224
/**

tests/lib/Integration/PackageTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,8 @@ public function testReadBlog()
5151
/**
5252
* Test that we can read a resource from the application.
5353
*/
54-
public function testReadPost()
54+
public function testReadPost(): void
5555
{
56-
$this->resourceType = 'posts';
57-
5856
/** @var Post $post */
5957
$post = factory(Post::class)->create();
6058

tests/lib/Integration/Validation/QueryValidationTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ public function testSearch(array $params, string $param, string $detail)
117117
'source' => ['parameter' => $param],
118118
];
119119

120-
$this->resourceType = 'posts';
121-
122120
$response = $this
123121
->jsonApi('posts')
124122
->query($params)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy