Skip to content

Commit 361fd6c

Browse files
committed
Merge 4.0
2 parents deb2ed2 + 1a8dea7 commit 361fd6c

25 files changed

+151
-46
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@
1717
* [d0a442786](https://github.com/api-platform/core/commit/d0a44278630d201b91cbba0774a09f4eeaac88f7) feat(doctrine): enhance getLinksHandler with method validation and typo suggestions (#6874)
1818
* [f67f6f1ac](https://github.com/api-platform/core/commit/f67f6f1acb6476182c18a3503f2a8bc80ae89a0b) feat(doctrine): doctrine filters like laravel eloquent filters (#6775)
1919

20+
## v4.0.14
21+
22+
### Bug fixes
23+
24+
* [97cdb6b3f](https://github.com/api-platform/core/commit/97cdb6b3f43471789e096c9dc3a0c3c7b6d4e43c) fix(state): remove ProcessorInterface laravel specific type
25+
* [b12a0d005](https://github.com/api-platform/core/commit/b12a0d005fda58a162b82a3574e6ee877838a55b) fix(graphql): register types for parameter args (#6895)
26+
27+
### Features
28+
2029
## v4.0.13
2130

2231
### Bug fixes
@@ -265,6 +274,18 @@ Notes:
265274

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

277+
## v3.4.14
278+
279+
### Bug fixes
280+
281+
* [0cf752bce](https://github.com/api-platform/core/commit/0cf752bcec692718b2503250e655d05aea670316) fix(metadata): make the schema attribute to fallback to null for parameters in YamlResourceExtractor (#6896)
282+
* [2b3c55db2](https://github.com/api-platform/core/commit/2b3c55db2a9ecc52f62c441fa8a5696233a30b87) fix(symfony): remove unsolvable deprecation (#6899) see also (#6655)
283+
* [9493b9b6e](https://github.com/api-platform/core/commit/9493b9b6ec0264ab5b700c861ad1b97455b4f88d) fix(symfony): revert json schema bc break (#6903)
284+
* [b82f9ac76](https://github.com/api-platform/core/commit/b82f9ac76ce89dd3910849c73da42317ee1339ed) fix(openapi): not forbidden response on openAPI doc (#6886)
285+
286+
I mispublished a v3.4.13 on some repositories to fix them all I bumped 3.4.10 to 3.4.14
287+
More details at #6888.
288+
268289
## v3.4.10
269290

270291
### Bug fixes

src/GraphQl/Type/FieldsBuilder.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,15 @@ private function getResourceFieldConfiguration(?string $property, ?string $field
415415
}
416416

417417
$args = $this->getFilterArgs($args, $resourceClass, $rootResource, $resourceOperation, $rootOperation, $property, $depth);
418-
$args = $this->getParameterArgs($rootOperation, $args);
418+
419+
// Also register parameter args in the types container
420+
// Note: This is a workaround, for more information read the comment on the parameterToObjectType function.
421+
foreach ($this->getParameterArgs($rootOperation) as $key => $arg) {
422+
if ($arg instanceof InputObjectType || (\is_array($arg) && isset($arg['name']))) {
423+
$this->typesContainer->set(\is_array($arg) ? $arg['name'] : $arg->name(), $arg);
424+
}
425+
$args[$key] = $arg;
426+
}
419427
}
420428
}
421429

src/Laravel/ApiPlatformProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,6 @@ public function register(): void
429429
$this->app->bind(OperationMetadataFactoryInterface::class, OperationMetadataFactory::class);
430430

431431
$this->app->tag([
432-
BooleanFilter::class,
433432
EqualsFilter::class,
434433
PartialSearchFilter::class,
435434
DateFilter::class,

src/Laravel/Eloquent/Filter/DateFilter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ public function getSchema(Parameter $parameter): array
8484
return ['type' => 'date'];
8585
}
8686

87-
public function getOpenApiParameters(Parameter $parameter): OpenApiParameter|array|null
87+
/**
88+
* @return OpenApiParameter[]
89+
*/
90+
public function getOpenApiParameters(Parameter $parameter): array
8891
{
8992
$in = $parameter instanceof QueryParameter ? 'query' : 'header';
9093
$key = $parameter->getKey();

src/Laravel/Eloquent/Filter/OrFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function getSchema(Parameter $parameter): array
4949
return ['type' => 'array', 'items' => $schema];
5050
}
5151

52-
public function getOpenApiParameters(Parameter $parameter): OpenApiParameter|array|null
52+
public function getOpenApiParameters(Parameter $parameter): OpenApiParameter
5353
{
5454
return new OpenApiParameter(name: $parameter->getKey().'[]', in: 'query', style: 'deepObject', explode: true);
5555
}

src/Laravel/Eloquent/Filter/OrderFilter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ public function getSchema(Parameter $parameter): array
5454
return ['type' => 'string', 'enum' => ['asc', 'desc']];
5555
}
5656

57-
public function getOpenApiParameters(Parameter $parameter): OpenApiParameter|array|null
57+
/**
58+
* @return OpenApiParameter[]|null
59+
*/
60+
public function getOpenApiParameters(Parameter $parameter): ?array
5861
{
5962
if (str_contains($parameter->getKey(), ':property')) {
6063
$parameters = [];

src/Laravel/Eloquent/Filter/RangeFilter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ public function getSchema(Parameter $parameter): array
5252
return ['type' => 'number'];
5353
}
5454

55-
public function getOpenApiParameters(Parameter $parameter): OpenApiParameter|array|null
55+
/**
56+
* @return OpenApiParameter[]
57+
*/
58+
public function getOpenApiParameters(Parameter $parameter): array
5659
{
5760
$in = $parameter instanceof QueryParameter ? 'query' : 'header';
5861
$key = $parameter->getKey();

src/Laravel/Eloquent/Paginator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(
3434

3535
public function count(): int
3636
{
37-
return $this->paginator->count();
37+
return $this->paginator->count(); // @phpstan-ignore-line
3838
}
3939

4040
public function getLastPage(): float

src/Laravel/Eloquent/PartialPaginator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(
3333

3434
public function count(): int
3535
{
36-
return $this->paginator->count();
36+
return $this->paginator->count(); // @phpstan-ignore-line
3737
}
3838

3939
public function getCurrentPage(): float

src/Laravel/Routing/IriConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ private function generateRoute(object|string $resource, int $referenceType = Url
159159
if (\is_object($resource)) {
160160
try {
161161
$identifiers = $this->identifiersExtractor->getIdentifiersFromItem($resource, $identifiersExtractorOperation, $context);
162-
} catch (InvalidArgumentException|RuntimeException $e) {
162+
} catch (RuntimeException $e) {
163163
// We can try using context uri variables if any
164164
if (!$identifiers) {
165165
throw new InvalidArgumentException(\sprintf('Unable to generate an IRI for the item of type "%s"', $operation->getClass()), $e->getCode(), $e);

0 commit comments

Comments
 (0)