Skip to content

Commit afd3dd4

Browse files
committed
Merge 3.4
2 parents 7c56896 + 70e9b9a commit afd3dd4

File tree

4 files changed

+55
-7
lines changed

4 files changed

+55
-7
lines changed

CHANGELOG.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,48 @@
4545

4646
* [0d5f35683](https://github.com/api-platform/core/commit/0d5f356839eb6aa9f536044abe4affa736553e76) feat(laravel): laravel component (#5882)
4747

48+
## v3.4.0
49+
50+
### Deprecations:
51+
52+
Namespaces like `ApiPlatform/Api` or `ApiPlatform/Util` are deprecated and will be removed in 4.0.
53+
You should now install `api-platform/symfony` instead of `api-platform/core`.
54+
55+
Read the [upgrade guide](https://api-platform.com/docs/core/upgrade-guide/) for detailed steps.
56+
57+
### Bug fixes
58+
59+
* [56153b755](https://github.com/api-platform/core/commit/56153b755151ee11c8c17fdc3fd919d544f078ac) fix(hydra): error hydra prefix (#6599)
60+
* [7c89f66a5](https://github.com/api-platform/core/commit/7c89f66a534cc1100c3dab0a129381d307d9d8b4) fix: replace ApiPlatform\\Exception use by ApiPlatform\Metadata\\Exception (#6597)
61+
* [a3a4a990d](https://github.com/api-platform/core/commit/a3a4a990d527136f093b022782a82e1d5b04c0b5) fix(metadata): loop on operations can be null
62+
* [ef0ee6427](https://github.com/api-platform/core/commit/ef0ee6427f8056bcb2617c228a7cf9ffd9d29ccd) fix(doctrine): use parameter.property for filter value (#6572)
63+
* [17c6b586c](https://github.com/api-platform/core/commit/17c6b586c5ab49437ac11dd092efdd5f0baf569b) fix(state): log on missing provider (#6519)
64+
* [601ccfb42](https://github.com/api-platform/core/commit/601ccfb4243803f40a7fa7179e0661da59c88b86) fix(doctrine): move event listeners to doctrine/common (#6573)
65+
* [6499e0aa5](https://github.com/api-platform/core/commit/6499e0aa5dd61fdff7706e7940cdf8c1fc3e18ef) fix: deprecate url generator interface namespace (#6575)
66+
* [3c5aea80f](https://github.com/api-platform/core/commit/3c5aea80fdbed20216764f6d721fe4f37cf2889d) fix(symfony): load isApiResource metadata (#6562)
67+
* [61af0cc90](https://github.com/api-platform/core/commit/61af0cc90c1e095edb12e32ef433a742ef46637e) fix(doctrine): allow doctrine/dbal:^4
68+
* [e063b80af](https://github.com/api-platform/core/commit/e063b80afe012ca4a6c8999de55b59193e8ae0ae) fix: parameter context for filters (#6535)
69+
* [e22392193](https://github.com/api-platform/core/commit/e22392193bb1fc71ece5abf393fa54b0745fc287) fix(state): security parameter with listeners (#6457)
70+
71+
Various fixes for components isolation.
72+
73+
### Features
74+
75+
* [130fb5a8c](https://github.com/api-platform/core/commit/130fb5a8c833430e5e09624b06f296e0bcb7ceed) feat: better path sorting for openapi UIs (#6583)
76+
* [26d700e06](https://github.com/api-platform/core/commit/26d700e06035eaf4d04ddd52f3101dae690734d8) feat(symfony): add error page (#6389)
77+
* [48267c9b6](https://github.com/api-platform/core/commit/48267c9b6a942b1fb54f0efcfa5b2d2ac47c93bf) feat(openapi): add error resources schemes (#6332)
78+
* [e91c783a2](https://github.com/api-platform/core/commit/e91c783a2abf51bf2bdcf1230826108632c44a0d) feat(state): "deserializer_type" context (#6429)
79+
* [17c6b586c](https://github.com/api-platform/core/commit/17c6b586c5ab49437ac11dd092efdd5f0baf569b) feat(state): log on missing provider (#6519)
80+
* [05e75be83](https://github.com/api-platform/core/commit/05e75be834c629e0487caaaedfe9fdf0bd5a7226) feat(doctrine): add new filter for filtering an entity using PHP backed enum, resolves #6506 (#6547) (#6560)
81+
* [0b985ae76](https://github.com/api-platform/core/commit/0b985ae760bc4689d3f5bbacebb21b35b334d0be) feat(state): add security to parameters (#6435)
82+
* [63ccfd58c](https://github.com/api-platform/core/commit/63ccfd58c95b5aa4aa0353eb122d96ef35187222) feat: BackedEnum resources (#6309)
83+
* [65296eaf1](https://github.com/api-platform/core/commit/65296eaf1eb18dc725e9316e9ab49b191aae43a3) feat(openapi): allow optional request body content (#6374)
84+
* [7399fcf7e](https://github.com/api-platform/core/commit/7399fcf7eaf28cd649d137da1fdd54f69093e275) feat(symfony): skip error handler (#6463)
85+
* [74986cb55](https://github.com/api-platform/core/commit/74986cb552182dc645bd1fc967faa0954dd59e0a) feat: inflector as service (#6447)
86+
* [b47edb2a4](https://github.com/api-platform/core/commit/b47edb2a499c34e79c167f963e3a626a3e9d040a) feat(serializer): context IRI in HAL or JsonApi format (#6215)
87+
* [db1241c66](https://github.com/api-platform/core/commit/db1241c66a08d226f57d8d61e0ec519071c6afdb) feat(openapi): make open_api_override_responses act on default 404 response generation (#6551)
88+
* [e09e73efc](https://github.com/api-platform/core/commit/e09e73efc5b4a39ab33d00c5d5422d8d9f7b5e89) feat: remove hydra prefix (#6418)
89+
4890
## v3.4.0-alpha.5
4991

5092
### Deprecations:

src/Metadata/Resource/Factory/BackedEnumResourceMetadataCollectionFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function create(string $resourceClass): ResourceMetadataCollection
3838

3939
foreach ($resourceMetadataCollection as $i => $resourceMetadata) {
4040
$newOperations = [];
41-
foreach ($resourceMetadata->getOperations() as $operationName => $operation) {
41+
foreach ($resourceMetadata->getOperations() ?? [] as $operationName => $operation) {
4242
$newOperations[$operationName] = $operation;
4343

4444
if (null !== $operation->getProvider()) {
@@ -49,7 +49,7 @@ public function create(string $resourceClass): ResourceMetadataCollection
4949
}
5050

5151
$newGraphQlOperations = [];
52-
foreach ($resourceMetadata->getGraphQlOperations() as $operationName => $operation) {
52+
foreach ($resourceMetadata->getGraphQlOperations() ?? [] as $operationName => $operation) {
5353
$newGraphQlOperations[$operationName] = $operation;
5454

5555
if (null !== $operation->getProvider()) {

src/State/Pagination/TraversablePaginator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ public function count(): int
6868
return (int) ceil($this->totalItems);
6969
}
7070

71+
if ($this->totalItems === $this->itemsPerPage) {
72+
return (int) ceil($this->totalItems);
73+
}
74+
7175
return $this->totalItems % $this->itemsPerPage;
7276
}
7377

tests/State/Pagination/TraversablePaginatorTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@ public function testInitialize(
4545
public static function initializeProvider(): array
4646
{
4747
return [
48-
'First of three pages of 3 items each' => [[0, 1, 2, 3, 4, 5, 6], 1, 3, 7, 3, 3, true],
49-
'Second of two pages of 3 items for the first page and 2 for the second' => [[0, 1, 2, 3, 4], 2, 3, 5, 2, 2, false],
50-
'Empty results' => [[], 1, 2, 0, 1, 0, false],
51-
'0 items per page' => [[0, 1, 2, 3], 1, 0, 4, 1, 4, false],
52-
'Total items less than items per page' => [[0, 1, 2], 1, 4, 3, 1, 3, false],
48+
'First of three pages of 3 items each' => [[0, 1, 2, 3, 4, 5, 6], 1, 3, 7, 3, 3],
49+
'Second of two pages of 3 items for the first page and 2 for the second' => [[0, 1, 2, 3, 4], 2, 3, 5, 2, 2],
50+
'Empty results' => [[], 1, 2, 0, 1, 0],
51+
'0 items per page' => [[0, 1, 2, 3], 1, 0, 4, 1, 4],
52+
'Total items less than items per page' => [[0, 1, 2], 1, 4, 3, 1, 3],
53+
'Only one result' => [[0], 1, 1, 1, 1, 1],
54+
'Same result number than total page' => [[0, 2, 3], 1, 3, 3, 1, 3],
5355
];
5456
}
5557
}

0 commit comments

Comments
 (0)