Skip to content

Commit 66e2672

Browse files
Merge 3.2 (#6145)
* fix(hydra): move owl:maxCardinality from JsonSchema to Hydra (#6136) * docs: changelog v3.2.13 * cs: missing strict type * docs: guide sf/apip version * test: security configuration * chore: fix CI (#6143) * chore: fix wrong namespace in test document * chore: fix CS nullable_type_declaration_for_default_null_value * chore: update GitHub Actions versions --------- Co-authored-by: Vincent <407859+vincentchalamon@users.noreply.github.com>
1 parent 7e05f45 commit 66e2672

File tree

269 files changed

+1129
-1119
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

269 files changed

+1129
-1119
lines changed

docs/src/Kernel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Kernel extends BaseKernel
4545
private $declaredClasses = [];
4646
private string $guide;
4747

48-
public function __construct(string $environment, bool $debug, string $guide = null)
48+
public function __construct(string $environment, bool $debug, ?string $guide = null)
4949
{
5050
parent::__construct($environment, $debug);
5151

@@ -118,7 +118,7 @@ private function configureContainer(ContainerConfigurator $container, LoaderInte
118118
}
119119
}
120120

121-
public function request(Request $request = null): Response
121+
public function request(?Request $request = null): Response
122122
{
123123
if (null === $request && \function_exists('App\Playground\request')) {
124124
$request = request();

features/openapi/docs.feature

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ Feature: Documentation support
9898
And the "playMode" property for the OpenAPI class "VideoGame" should be equal to:
9999
"""
100100
{
101-
"owl:maxCardinality": 1,
102101
"type": "string",
103102
"format": "iri-reference",
104103
"example": "https://example.com/"
@@ -310,7 +309,6 @@ Feature: Documentation support
310309
And the "resourceRelated" property for the OpenAPI class "Resource" should be equal to:
311310
"""
312311
{
313-
"owl:maxCardinality": 1,
314312
"readOnly": true,
315313
"anyOf": [
316314
{
@@ -389,7 +387,6 @@ Feature: Documentation support
389387
And the "data" property for the OpenAPI class "WrappedResponseEntity.CustomOutputEntityWrapperDto-read" should be equal to:
390388
"""
391389
{
392-
"owl:maxCardinality": 1,
393390
"$ref": "#\/components\/schemas\/WrappedResponseEntity-read"
394391
}
395392
"""

src/Action/EntrypointAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(
4141
/**
4242
* @return Entrypoint|Response
4343
*/
44-
public function __invoke(Request $request = null)
44+
public function __invoke(?Request $request = null)
4545
{
4646
if ($this->provider && $this->processor) {
4747
$context = ['request' => $request];

src/Action/ExceptionAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ final class ExceptionAction
4343
* @param array $errorFormats A list of enabled error formats
4444
* @param array $exceptionToStatus A list of exceptions mapped to their HTTP status code
4545
*/
46-
public function __construct(private readonly SerializerInterface $serializer, private readonly array $errorFormats, private readonly array $exceptionToStatus = [], ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory = null)
46+
public function __construct(private readonly SerializerInterface $serializer, private readonly array $errorFormats, private readonly array $exceptionToStatus = [], ?ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory = null)
4747
{
4848
$this->resourceMetadataCollectionFactory = $resourceMetadataCollectionFactory;
4949
}

src/Api/FilterLocatorTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private function setFilterLocator(?ContainerInterface $filterLocator, bool $allo
4545
/**
4646
* Gets a filter with a backward compatibility.
4747
*/
48-
private function getFilter(string $filterId): null|FilterInterface|MetadataFilterInterface
48+
private function getFilter(string $filterId): FilterInterface|MetadataFilterInterface|null
4949
{
5050
if ($this->filterLocator && $this->filterLocator->has($filterId)) {
5151
return $this->filterLocator->get($filterId);

src/Api/IdentifiersExtractor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ final class IdentifiersExtractor implements IdentifiersExtractorInterface
3737
use ResourceClassInfoTrait;
3838
private readonly PropertyAccessorInterface $propertyAccessor;
3939

40-
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory, ResourceClassResolverInterface $resourceClassResolver, private readonly PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, private readonly PropertyMetadataFactoryInterface $propertyMetadataFactory, PropertyAccessorInterface $propertyAccessor = null)
40+
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory, ResourceClassResolverInterface $resourceClassResolver, private readonly PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, private readonly PropertyMetadataFactoryInterface $propertyMetadataFactory, ?PropertyAccessorInterface $propertyAccessor = null)
4141
{
4242
$this->resourceMetadataFactory = $resourceMetadataFactory;
4343
$this->resourceClassResolver = $resourceClassResolver;
@@ -49,7 +49,7 @@ public function __construct(ResourceMetadataCollectionFactoryInterface $resource
4949
*
5050
* TODO: 3.0 identifiers should be stringable?
5151
*/
52-
public function getIdentifiersFromItem(object $item, Operation $operation = null, array $context = []): array
52+
public function getIdentifiersFromItem(object $item, ?Operation $operation = null, array $context = []): array
5353
{
5454
if (!$this->isResourceClass($this->getObjectClass($item))) {
5555
return ['id' => $this->propertyAccessor->getValue($item, 'id')];
@@ -96,7 +96,7 @@ private function getIdentifiersFromOperation(object $item, Operation $operation,
9696
/**
9797
* Gets the value of the given class property.
9898
*/
99-
private function getIdentifierValue(object $item, string $class, string $property, string $parameterName, string $toProperty = null): float|bool|int|string
99+
private function getIdentifierValue(object $item, string $class, string $property, string $parameterName, ?string $toProperty = null): float|bool|int|string
100100
{
101101
if ($item instanceof $class) {
102102
try {

src/Api/IdentifiersExtractorInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ interface IdentifiersExtractorInterface
2828
*
2929
* @throws RuntimeException
3030
*/
31-
public function getIdentifiersFromItem(object $item, Operation $operation = null, array $context = []): array;
31+
public function getIdentifiersFromItem(object $item, ?Operation $operation = null, array $context = []): array;
3232
}

src/Api/IriConverterInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ interface IriConverterInterface
3131
* @throws InvalidArgumentException
3232
* @throws ItemNotFoundException
3333
*/
34-
public function getResourceFromIri(string $iri, array $context = [], Operation $operation = null): object;
34+
public function getResourceFromIri(string $iri, array $context = [], ?Operation $operation = null): object;
3535

3636
/**
3737
* Gets the IRI associated with the given item.
@@ -41,5 +41,5 @@ public function getResourceFromIri(string $iri, array $context = [], Operation $
4141
* @throws InvalidArgumentException
4242
* @throws RuntimeException
4343
*/
44-
public function getIriFromResource(object|string $resource, int $referenceType = UrlGeneratorInterface::ABS_PATH, Operation $operation = null, array $context = []): ?string;
44+
public function getIriFromResource(object|string $resource, int $referenceType = UrlGeneratorInterface::ABS_PATH, ?Operation $operation = null, array $context = []): ?string;
4545
}

src/Api/ResourceClassResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct(private readonly ResourceNameCollectionFactoryInterf
3838
/**
3939
* {@inheritdoc}
4040
*/
41-
public function getResourceClass(mixed $value, string $resourceClass = null, bool $strict = false): string
41+
public function getResourceClass(mixed $value, ?string $resourceClass = null, bool $strict = false): string
4242
{
4343
if ($strict && null === $resourceClass) {
4444
throw new InvalidArgumentException('Strict checking is only possible when resource class is specified.');

src/Api/ResourceClassResolverInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ interface ResourceClassResolverInterface
3030
*
3131
* @throws InvalidArgumentException
3232
*/
33-
public function getResourceClass(mixed $value, string $resourceClass = null, bool $strict = false): string;
33+
public function getResourceClass(mixed $value, ?string $resourceClass = null, bool $strict = false): string;
3434

3535
/**
3636
* Is the given class a resource class?

0 commit comments

Comments
 (0)