Skip to content

Commit 6f27b8e

Browse files
committed
[Build] Update for PHP 7.4
1 parent 9cd9630 commit 6f27b8e

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ matrix:
3636
env:
3737
- LARAVEL_VERSION=^6.0
3838
- PHPUNIT_VERSION=^8.0
39+
- php: "7.4"
40+
env:
41+
- LARAVEL_VERSION=5.8.*
42+
- PHPUNIT_VERSION=^7.0
43+
- php: "7.4"
44+
env:
45+
- LARAVEL_VERSION=^6.0
46+
- PHPUNIT_VERSION=^8.0
3947

4048
install:
4149
- composer require "laravel/framework:${LARAVEL_VERSION}" --no-update -n

CHANGELOG.md

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

55
## Unreleased
66

7+
### Added
8+
- Updated to support PHP `7.4` (minimum PHP remains `7.1`).
9+
710
### Changed
811
- [#440](https://github.com/cloudcreativity/laravel-json-api/pull/440)
912
Amend query method signature on validated request to match Laravel request signature.
@@ -161,7 +164,7 @@ Refactored content negotiation so that multiple media types can be supported. Re
161164
- Renamed a lot of classes in the `Routing` namespace. They are also marked as `final` because they
162165
are not meant to be extended.
163166
- Modified the abstract `mount` method that package providers use to add routes to an API.
164-
Also added PHP 7 type-hinting to all methods in the abstract class.
167+
Also added PHP 7 type-hinting to all methods in the abstract class.
165168

166169
### Fixed
167170
- [#265](https://github.com/cloudcreativity/laravel-json-api/issues/265)
@@ -211,7 +214,7 @@ some time.
211214
- [#277](https://github.com/cloudcreativity/laravel-json-api/pull/277)
212215
Eloquent adapter can now support soft-deleting, restoring and force-deleting resources by applying
213216
a trait to the adapter. See the soft-deletes documentation chapter for details.
214-
- [#247](https://github.com/cloudcreativity/laravel-json-api/issues/247)
217+
- [#247](https://github.com/cloudcreativity/laravel-json-api/issues/247)
215218
New date time rule object to validate a JSON date string is a valid ISO 8601 date and time format.
216219
- [#261](https://github.com/cloudcreativity/laravel-json-api/pull/261)
217220
Package now supports the JSON API recommendation for asynchronous processing. See the
@@ -263,7 +266,7 @@ If a client sends a client-generated ID for a resource that does not support cli
263266
`403 Forbidden` response will be sent, as defined in the JSON API spec.
264267

265268
### Removed
266-
- The deprecated `Contracts\Store\AdapterInterface` was removed. Use
269+
- The deprecated `Contracts\Store\AdapterInterface` was removed. Use
267270
`Contracts\Adapter\ResourceAdapterInterface` instead.
268271
- The deprecated `Adapter\HydratesAttributesTrait` was removed.
269272
- The `Contracts\Http\Requests\RequestInterface` was removed as it is no longer necessary (because the
@@ -336,7 +339,7 @@ at `2.0`. You should use the error interface/class from the `neomerx/jsonapi` pa
336339
- `Utils/ErrorsAwareTrait` and `Contracts\Utils\ErrorsAwareInterface`
337340
- `Utils/Pointers`
338341
- `Utils/Replacer` and `Contracts\Utils\ReplacerInterface`
339-
- The `Contracts\Factories\FactoryInterface` is deprecated and will be removed at `1.0`.
342+
- The `Contracts\Factories\FactoryInterface` is deprecated and will be removed at `1.0`.
340343
You should type-hint `Factories\Factory` directly instead.
341344

342345
## [1.0.0-beta.3] - 2018-09-21
@@ -432,7 +435,7 @@ allows schemas, adapters etc to be bound into the container rather than having t
432435
classes.
433436

434437
### Fixed
435-
- [#202](https://github.com/cloudcreativity/laravel-json-api/issues/202)
438+
- [#202](https://github.com/cloudcreativity/laravel-json-api/issues/202)
436439
When appending the schema and host on a request, the base URL is now also appended. This caters
437440
for Laravel applications that are served from host sub-directories.
438441

@@ -457,7 +460,7 @@ contains the implementation that was previously on the Eloquent adapter.
457460
can now be used when testing JSON API packages.
458461
- Merged the two resolvers provided by this package into a single class.
459462
- [#176](https://github.com/cloudcreativity/laravel-json-api/issues/176)
460-
When using *not-by-resource* resolution, the type of the class is now appended to the class name. E.g.
463+
When using *not-by-resource* resolution, the type of the class is now appended to the class name. E.g.
461464
`App\JsonApi\Adapters\PostAdapter` is now expected instead of `App\JsonApi\Adapters\Post`. The previous
462465
behaviour can be maintained by setting the `by-resource` config option to the string `false-0.x`.
463466
- The constructor dependencies for the `Repositories\ErrorRepository` have been simplified.
@@ -513,14 +516,14 @@ classes/traits are deprecated:
513516

514517
## [1.0.0-alpha.1] - 2018-04-29
515518

516-
As we are now only developing JSON API within Laravel applications, we have deprecated our framework agnostic
519+
As we are now only developing JSON API within Laravel applications, we have deprecated our framework agnostic
517520
`cloudcreativity/json-api` package. All the classes from that package have been merged into this package and
518521
renamed to the `CloudCreativity\LaravelJsonApi` namespace. This will allow us to more rapidly develop this
519522
Laravel package and simplify the code in subsequent releases.
520523

521524
### Added
522525
- New Eloquent relationship adapters allows full support for relationship endpoints.
523-
- Message bags can now have their keys mapped and/or dasherized when converting them to JSON API errors
526+
- Message bags can now have their keys mapped and/or dasherized when converting them to JSON API errors
524527
in the `ErrorBag` class.
525528
- JSON API resource paths are now automatically converted to model relationship paths for eager loading in
526529
the Eloquent adapter.
@@ -561,7 +564,7 @@ returned an empty array, `getFillable` would be used instead.
561564
- The `Schema\CreatesEloquentIdentities` trait is deprecated.
562565

563566
### Fixed
564-
- [#128](https://github.com/cloudcreativity/laravel-json-api/issues/128)
567+
- [#128](https://github.com/cloudcreativity/laravel-json-api/issues/128)
565568
Filter, sort and page parameters validation rules are excluded for resource requests for which those
566569
parameters do not apply (create, read, update and delete).
567570
- [#92](https://github.com/cloudcreativity/laravel-json-api/issues/92)

src/Eloquent/Concerns/SoftDeletesModels.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,11 @@ protected function saveOrRestore(Model $record)
184184
if ($this->willSoftDelete($record)) {
185185
$key = $this->getSoftDeleteKey($record);
186186
// save the original date so we can put it back later on
187-
$deletedAt = $record{$key};
187+
$deletedAt = $record->{$key};
188188
// delete on the record so that deleting and deleted events get fired
189189
$record->delete();
190190
// apply the original soft deleting date back before saving
191-
$record{$key} = $deletedAt;
191+
$record->{$key} = $deletedAt;
192192
}
193193

194194
$record->save();

0 commit comments

Comments
 (0)