Skip to content

Commit 2c4e07d

Browse files
Merge pull request #89 from MarcinOrlowski/dev
Release 6.0.0
2 parents 38f0953 + ea0877f commit 2c4e07d

40 files changed

+1875
-1987
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.idea/
22
vendor/
33
composer.lock
4+
.phpunit.result.cache

.travis.yml

-48
Original file line numberDiff line numberDiff line change
@@ -18,61 +18,14 @@ language: php
1818
dist: trusty
1919

2020
php:
21-
- 5.5
22-
- 5.6
23-
- 7.0
24-
- 7.1
2521
- 7.2
2622
- 7.3
2723

2824
env:
29-
- LARAVEL_VERSION="5.1"
30-
- LARAVEL_VERSION="5.2"
31-
- LARAVEL_VERSION="5.3"
32-
- LARAVEL_VERSION="5.4"
33-
- LARAVEL_VERSION="5.5"
34-
- LARAVEL_VERSION="5.6"
35-
- LARAVEL_VERSION="5.7"
36-
- LARAVEL_VERSION="5.8"
3725
- LARAVEL_VERSION="6.0"
3826

3927
matrix:
4028
exclude:
41-
- php: 5.5
42-
env: LARAVEL_VERSION="5.3"
43-
- php: 5.5
44-
env: LARAVEL_VERSION="5.4"
45-
- php: 5.5
46-
env: LARAVEL_VERSION="5.5"
47-
- php: 5.5
48-
env: LARAVEL_VERSION="5.6"
49-
- php: 5.5
50-
env: LARAVEL_VERSION="5.7"
51-
- php: 5.5
52-
env: LARAVEL_VERSION="5.8"
53-
- php: 5.5
54-
env: LARAVEL_VERSION="6.0"
55-
56-
- php: 5.6
57-
env: LARAVEL_VERSION="5.5"
58-
- php: 5.6
59-
env: LARAVEL_VERSION="5.6"
60-
- php: 5.6
61-
env: LARAVEL_VERSION="5.7"
62-
- php: 5.6
63-
env: LARAVEL_VERSION="5.8"
64-
- php: 5.6
65-
env: LARAVEL_VERSION="6.0"
66-
67-
- php: 7.0
68-
env: LARAVEL_VERSION="5.6"
69-
- php: 7.0
70-
env: LARAVEL_VERSION="5.7"
71-
- php: 7.0
72-
env: LARAVEL_VERSION="5.8"
73-
- php: 7.0
74-
env: LARAVEL_VERSION="6.0"
75-
7629
- php: 7.1
7730
env: LARAVEL_VERSION="6.0"
7831

@@ -88,7 +41,6 @@ before_script:
8841
- composer install "${FLAGS}"
8942
# We need to tweak signature so setUp() and tearDown() and strip ": void" otherwise PHP will fail complaining
9043
# This affects Laravel 5.8+ as they pull recent Orchestra that features method signature changes.
91-
- "if [ ${LARAVEL_VERSION} == 5.8 ]; then sed -i 's/): void/)/' vendor/orchestra/testbench-core/src/TestCase.php ; fi"
9244
- "if [ ${LARAVEL_VERSION} == 6.0 ]; then sed -i 's/): void/)/' vendor/orchestra/testbench-core/src/TestCase.php ; fi"
9345
- "if [ ${LARAVEL_VERSION} == 6.0 ]; then sed -i 's/): void/)/' vendor/phpunit/phpunit/src/Framework/TestCase.php ; fi"
9446

CHANGES.md

+34
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,40 @@ See [compatibility docs](docs/compatibility.md) for details about backward compa
66

77
## CHANGE LOG ##
88

9+
* v6.0.0 (2019-09-20)
10+
* **BACKWARD INCOMPATIBLE CHANGES** ([more info](docs/compatibility.md))
11+
* Requires Laravel 6.0+ and PHP 7.2+ (see docs for legacy support hints).
12+
* All API codes are now withing defined code range, incl. built-in codes.
13+
* Reserved code range lowered from former 63 down to 19.
14+
* Added type hints to all method arguments and return values
15+
* `ExceptionHandler` returns Exception-type related HTTP codes now as per configuration.
16+
* Fixed `ResponseBuilder::errorWithMessageAndData()` not passing data properly.
17+
* Fixed exception message of `ApiCodesHelpers::getMaxCode()`.
18+
* Corrected test cases list in `testSuccess_DataAndHttpCode()`.
19+
* Fixed error code fallback in `testRender_HttpException()` test.
20+
* Fixed `testError_DebugTrace()` not containing any asserts.
21+
* Reformatted code to not exceed 132 columns, for better on-line readability.
22+
* `ResponseBuilder::errorWithDataAndHttpCode()` accepts now `null` as http code.
23+
* `ResponseBuilder::errorWithHttpCode()` accepts now `null` as http code.
24+
* Fixed `ExceptionHandlerHelper` replacing HTTP codes above 499 with 400.
25+
* Changed default built-in message for `HTTP_NOT_FOUND` error.
26+
* `ExceptionHandler` now falls back to `EX_UNCAUGHT_EXCEPTION` for all the cases.
27+
* Simplified `ExceptionHandlerHelperTest::testRender_HttpException()` test.
28+
* Removed `exception_handler.use_exception_message_first` feature.
29+
* Removed `ResponseBuilder::DEFAULT_API_CODE_OK` constant.
30+
* Removed `getReservedMinCode()`, `getReservedMinCode()`, `getReservedMessageKey()` methods.
31+
* Removed internal API code constants. Use corresponding methods to get proprt code value.
32+
* Reimplemented Laravel config merger to support multi-dimensional configuration arrays too.
33+
* Removed `response_key_map` configuration option.
34+
* You can now return HTTP codes from 5xx range with all error responses.
35+
36+
* v5.0.0
37+
* Skipped to catch up with Laravel version numeration.
38+
39+
* v4.1.9 (2019-08-08)
40+
* Fixed `ApiCodesHelpers::getMaxCode()` exception message
41+
* Fixed `ResponseBuilder::errorWithMessageAndData()` not passing args properly
42+
943
* v4.1.8 (2019-08-07)
1044
* Added Laravel 6 to testing setup
1145

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,8 @@
7070

7171
* Easy to use,
7272
* [Stable and production ready](https://travis-ci.org/MarcinOrlowski/laravel-api-response-builder),
73-
* Laravel 5.1 to 6.0 compatible,
74-
* Supports Laravel [auto-discovery](https://medium.com/@taylorotwell/package-auto-discovery-in-laravel-5-5-ea9e3ab20518) (5.5 and up),
75-
* Works on PHP 5.5, 5.6, 7.0, 7.1, 7.2 and 7.3,
73+
* Laravel 6.0 compatible (see [legacy support](docs/legacy.md) for support for older versions),
74+
* Supports Laravel [auto-discovery](https://medium.com/@taylorotwell/package-auto-discovery-in-laravel-5-5-ea9e3ab20518),
7675
* Configurable (with ready-to-use defaults),
7776
* Localization support,
7877
* Automatic object conversion with custom mapping,

composer.json

+17-13
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22
"name": "marcin-orlowski/laravel-api-response-builder",
33
"description": "Helps building nice, normalized and easy to consume Laravel REST API.",
44
"homepage": "https://github.com/MarcinOrlowski/laravel-api-response-builder",
5-
"version": "4.1.7",
5+
"version": "6.0.0",
66
"keywords": [
77
"laravel",
88
"json",
99
"api",
1010
"builder",
1111
"rest",
12-
"helper"
12+
"helper",
13+
"php7",
14+
"mobile",
15+
"android",
16+
"ios"
1317
],
1418
"license": "MIT",
1519
"authors": [
@@ -23,15 +27,15 @@
2327
"issues": "https://github.com/MarcinOrlowski/laravel-api-response-builder/issues"
2428
},
2529
"extra": {
26-
"laravel": {
27-
"providers": [
28-
"MarcinOrlowski\\ResponseBuilder\\ResponseBuilderServiceProvider"
29-
]
30-
}
30+
"laravel": {
31+
"providers": [
32+
"MarcinOrlowski\\ResponseBuilder\\ResponseBuilderServiceProvider"
33+
]
34+
}
3135
},
3236
"require": {
33-
"php": ">=5.5.9",
34-
"laravel/framework": "^5.1"
37+
"php": ">=7.2.0",
38+
"laravel/framework": "^6.0"
3539
},
3640
"autoload": {
3741
"classmap": [
@@ -42,10 +46,10 @@
4246
},
4347
"require-dev": {
4448
"marcin-orlowski/coding-standard": "^1.1",
45-
"phpunit/phpunit": "^4.8",
46-
"phpunit/php-code-coverage": "^2.2.4",
47-
"mockery/mockery": "^0.9.8",
48-
"orchestra/testbench": "^3.1",
49+
"orchestra/testbench": "^4.0",
50+
"laravel/framework": "^6.0",
51+
"phpunit/phpunit": "^8.0",
52+
"phpunit/php-code-coverage": "^7.0",
4953
"codacy/coverage": "^1.0"
5054
}
5155
}

0 commit comments

Comments
 (0)