Skip to content
This repository was archived by the owner on Feb 14, 2023. It is now read-only.

Commit a84326f

Browse files
author
Andrey Helldar
committed
Added upgrade guide
1 parent 8decec8 commit a84326f

File tree

2 files changed

+69
-10
lines changed

2 files changed

+69
-10
lines changed

.upgrading/5.x_6.x.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Upgrade Guide
2+
3+
## Upgrading To 6.x From 5.x
4+
5+
### PHP 7.3 Required
6+
7+
The new minimum PHP version is now 7.3.
8+
9+
### Updating Dependencies
10+
11+
Update your `andrey-helldar/api-response` dependency to `^6.0` in your `composer.json` file.
12+
13+
14+
### `api_response` function
15+
16+
Changed the order of `api_response` function attributes from:
17+
```php
18+
function api_response(
19+
$data = null,
20+
int $status_code = 200,
21+
array $headers = [],
22+
array $with = [],
23+
bool $use_data = true
24+
)
25+
```
26+
27+
to:
28+
```php
29+
function api_response(
30+
$data = null,
31+
int $status_code = 200,
32+
array $with = [],
33+
array $headers = [],
34+
bool $use_data = true
35+
)
36+
```
37+
38+
### The `status` method
39+
40+
The `status` method from `Helldar\ApiResponse\Services\Response` has been removed.
41+
42+
43+
### The `data` method
44+
45+
`data` method from `Helldar\ApiResponse\Services\Response` added status code attribute:
46+
```php
47+
function data(
48+
$data = null,
49+
int $status_code = 200,
50+
bool $use_data = true
51+
)
52+
```

README.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Package for standardizing the responses from the API of your **Symfony based** a
1919

2020
## Content
2121
* [Installation](#installation)
22+
* [Compatibility table](#compatibility-table)
2223
* [Using](#using)
2324
* [Use with `data` key](#use-with-data-key)
2425
* [as NULL with code](#as-null-with-code)
@@ -51,16 +52,7 @@ $ composer require andrey-helldar/api-response
5152

5253
This command will automatically install the latest version of the package for your environment.
5354

54-
Or you can manually set the required version, following the table:
55-
56-
| Package version | PHP version | Symfony version | Command |
57-
|:---:|:---:|:---:|:---|
58-
| ^4.0 | 5.6.9+ | ^3.0, ^4.0 | `composer require andrey-helldar/api-response:^4.0` |
59-
| ^4.4.1 | 5.6.9+ | ^3.0, ^4.0, ^5.0 | `composer require andrey-helldar/api-response:^4.4` |
60-
| ^5.0 | 7.1.3+ | ^4.0, ^5.0 | `composer require andrey-helldar/api-response:^5.0` |
61-
| ^6.0 | 7.3+ | ^4.0, ^5.0 | `composer require andrey-helldar/api-response` |
62-
63-
Instead, you may of course manually update your require block and run `composer update` if you so choose:
55+
Instead, you may of course manually update your `require` block and run `composer update` if you so choose:
6456

6557
```json
6658
{
@@ -72,6 +64,17 @@ Instead, you may of course manually update your require block and run `composer
7264

7365
Alright! Use `api_response()` helper.
7466

67+
68+
### Compatibility table
69+
70+
| Package version | PHP min version | Symfony version | Support | Links |
71+
|:---:|:---:|:---:|:---|:---|
72+
| ^4.0 | 5.6.9 | ^3.0, ^4.0 | ![Not Supported][badge_not_supported] | --- |
73+
| ^4.4.1 | 5.6.9 | ^3.0, ^4.0, ^5.0 | ![Not Supported][badge_not_supported] | --- |
74+
| ^5.0 | 7.1.3 | ^4.0, ^5.0 | ![Not Supported][badge_not_supported] | --- |
75+
| ^6.0 | 7.3 | ^4.0, ^5.0 | ![Supported][badge_supported] | [Upgrade guide](.upgrading/5.x_6.x.md) |
76+
77+
7578
[[ to top ]](#api-response)
7679

7780

@@ -648,3 +651,7 @@ class Handler extends ExceptionHandler
648651
`API Response` was written by Andrey Helldar, and is licensed under the [MIT License](LICENSE).
649652

650653
[[ to top ]](#api-response)
654+
655+
656+
[badge_supported]: https://img.shields.io/badge/supported-green?style=flat-square
657+
[badge_not_supported]: https://img.shields.io/badge/not--supported-lightgrey?style=flat-square

0 commit comments

Comments
 (0)