diff --git a/.travis.yml b/.travis.yml index 741cb0b..cc1ea2e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,6 @@ language: php matrix: include: - - php: "7.0" - env: LARAVEL_VERSION="5.5.*" - php: "7.1" env: LARAVEL_VERSION="5.5.*" - php: "7.2" @@ -11,7 +9,11 @@ matrix: - php: "7.2" env: LARAVEL_VERSION="5.6.*" - php: "7.2" - env: LARAVEL_VERSION="5.7.*" RUN_CS_FIXER=1 + env: LARAVEL_VERSION="5.7.*" + - php: "7.2" + env: LARAVEL_VERSION="5.8.*" + - php: "7.3" + env: LARAVEL_VERSION="5.8.*" RUN_CS_FIXER=1 sudo: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 9630213..d0a3da0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All Notable changes to `json-api-server` will be documented in this file. Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## 0.4.0 + +### Added + +- Laravel 5.8 support. + ## 0.3.7 ### Fixed diff --git a/composer.json b/composer.json index 82d7799..31d51be 100644 --- a/composer.json +++ b/composer.json @@ -38,9 +38,9 @@ } ], "require": { - "php": "^7.0", + "php": ">=7.1.3", "dimsav/laravel-translatable": "^8.0|^9.0", - "laravel/framework": "5.5.*|5.6.*|5.7.*" + "laravel/framework": "5.5.*|5.6.*|5.7.*|5.8.*" }, "require-dev": { "filp/whoops": "~2.0", diff --git a/src/Http/Controllers/Api/BaseApiController.php b/src/Http/Controllers/Api/BaseApiController.php index e838b1c..8ff8760 100644 --- a/src/Http/Controllers/Api/BaseApiController.php +++ b/src/Http/Controllers/Api/BaseApiController.php @@ -126,7 +126,7 @@ public function delete($id) /** * @param $policyMethod * @param $item - * @param null|mixed $requestedObject + * @param mixed|null $requestedObject * * @throws ForbiddenException * @throws AuthorizationException diff --git a/src/Repositories/BaseApiRepository.php b/src/Repositories/BaseApiRepository.php index f232de5..8d27601 100644 --- a/src/Repositories/BaseApiRepository.php +++ b/src/Repositories/BaseApiRepository.php @@ -64,7 +64,7 @@ public function paginate($parameters = []) * * @throws NotFoundException * - * @return \Illuminate\Database\Eloquent\Collection|Model|null|static|static[] + * @return \Illuminate\Database\Eloquent\Collection|Model|static|static[]|null */ public function findById($value, $parameters = []) { @@ -93,7 +93,7 @@ public function create(array $data) * * @throws NotFoundException * - * @return \Illuminate\Database\Eloquent\Collection|Model|null|static|static[] + * @return \Illuminate\Database\Eloquent\Collection|Model|static|static[]|null */ public function update(array $data, $objectKey) { diff --git a/tests/CommandTestCase.php b/tests/CommandTestCase.php index 24fb15f..6186be9 100644 --- a/tests/CommandTestCase.php +++ b/tests/CommandTestCase.php @@ -4,7 +4,7 @@ class CommandTestCase extends TestCase { - public function setUp() + protected function setUp(): void { parent::setUp(); config(['laravel_api.path.templates' => 'resources/templates/']); diff --git a/tests/Unit/ControllerTest.php b/tests/Unit/ControllerTest.php index a5f9f01..99e2021 100644 --- a/tests/Unit/ControllerTest.php +++ b/tests/Unit/ControllerTest.php @@ -22,9 +22,10 @@ class ControllerTest extends TestCase /** @var TestModel */ protected $testModel; - public function setUp() + protected function setUp(): void { parent::setUp(); + $this->setUpDatabase($this->app); $this->testModel = new TestModel(['title' => 'test', 'body' => 'test']); $this->testModel->save(); diff --git a/tests/Unit/EmptyPaginatorTest.php b/tests/Unit/EmptyPaginatorTest.php index f361a25..7fbf72c 100644 --- a/tests/Unit/EmptyPaginatorTest.php +++ b/tests/Unit/EmptyPaginatorTest.php @@ -9,7 +9,7 @@ class EmptyPaginatorTest extends TestCase /** @var EmptyPaginator */ private $emptyPaginator; - protected function setUp() + protected function setUp(): void { $this->emptyPaginator = new EmptyPaginator(); } diff --git a/tests/Unit/HandleResponsesTest.php b/tests/Unit/HandleResponsesTest.php index 321efaf..4de711b 100644 --- a/tests/Unit/HandleResponsesTest.php +++ b/tests/Unit/HandleResponsesTest.php @@ -17,7 +17,7 @@ class HandleResponsesTest extends TestCase /** @var HandleResponses $mock */ private $mock; - protected function setUp() + protected function setUp(): void { $this->mock = $this->getMockForTrait(HandleResponses::class); parent::setUp(); // TODO: Change the autogenerated stub diff --git a/tests/Unit/InspectContentTypeTest.php b/tests/Unit/InspectContentTypeTest.php index cb9a6ef..2e517cb 100644 --- a/tests/Unit/InspectContentTypeTest.php +++ b/tests/Unit/InspectContentTypeTest.php @@ -20,7 +20,7 @@ class InspectContentTypeTest extends TestCase /** @var InspectContentType */ protected $middleware; - protected function setUp() + protected function setUp(): void { parent::setUp(); // TODO: Change the autogenerated stub $this->request = Request::create('http://example.com/admin', 'GET'); diff --git a/tests/Unit/RepositoryTest.php b/tests/Unit/RepositoryTest.php index 8bd57f4..6668d4a 100644 --- a/tests/Unit/RepositoryTest.php +++ b/tests/Unit/RepositoryTest.php @@ -23,7 +23,7 @@ class RepositoryTest extends TestCase * Bootstrap the database * Setup a base repository which most test cases use. */ - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->setUpDatabase($this->app); diff --git a/tests/Unit/ResponseServiceTest.php b/tests/Unit/ResponseServiceTest.php index 900e965..2a4e569 100644 --- a/tests/Unit/ResponseServiceTest.php +++ b/tests/Unit/ResponseServiceTest.php @@ -22,7 +22,7 @@ class ResponseServiceTest extends TestCase */ private $responseService; - public function setUp() + protected function setUp(): void { parent::setUp(); $this->responseService = new ResponseService();