Skip to content

Commit

Permalink
Merge 6806c0e into b5be5e0
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Dec 2, 2020
2 parents b5be5e0 + 6806c0e commit 70989f4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
Expand Up @@ -260,11 +260,6 @@ private function normalizeDefaults(array $defaults): array
$normalizedDefaults['attributes'][$option] = $value;
}

if (!\array_key_exists('stateless', $defaults)) {
@trigger_error('Not setting the "api_platform.defaults.stateless" configuration is deprecated since API Platform 2.6 and it will default to `true` in 3.0. You can override this at the operation level if you have stateful operations (highly not recommended).', E_USER_DEPRECATED);
$normalizedDefaults['attributes']['stateless'] = false;
}

return $normalizedDefaults;
}

Expand Down
Expand Up @@ -155,7 +155,6 @@ class ApiPlatformExtensionTest extends TestCase
],
'defaults' => [
'attributes' => [],
'stateless' => true,
],
]];

Expand Down Expand Up @@ -684,7 +683,7 @@ public function testEnableElasticsearch()
$containerBuilderProphecy->registerForAutoconfiguration(RequestBodySearchCollectionExtensionInterface::class)->willReturn($this->childDefinitionProphecy)->shouldBeCalled();
$containerBuilderProphecy->setParameter('api_platform.elasticsearch.hosts', ['http://elasticsearch:9200'])->shouldBeCalled();
$containerBuilderProphecy->setParameter('api_platform.elasticsearch.mapping', [])->shouldBeCalled();
$containerBuilderProphecy->setParameter('api_platform.defaults', ['attributes' => ['stateless' => true]])->shouldBeCalled();
$containerBuilderProphecy->setParameter('api_platform.defaults', ['attributes' => []])->shouldBeCalled();

$config = self::DEFAULT_CONFIG;
$config['api_platform']['elasticsearch'] = [
Expand Down Expand Up @@ -836,7 +835,7 @@ private function getPartialContainerBuilderProphecy($configuration = null)
'api_platform.http_cache.public' => null,
'api_platform.http_cache.invalidation.max_header_length' => 7500,
'api_platform.asset_package' => null,
'api_platform.defaults' => ['attributes' => ['stateless' => true]],
'api_platform.defaults' => ['attributes' => []],
'api_platform.enable_entrypoint' => true,
'api_platform.enable_docs' => true,
'api_platform.url_generation_strategy' => 1,
Expand Down Expand Up @@ -1141,7 +1140,7 @@ private function getBaseContainerBuilderProphecy(array $doctrineIntegrationsToLo
'api_platform.validator.serialize_payload_fields' => [],
'api_platform.elasticsearch.enabled' => false,
'api_platform.asset_package' => null,
'api_platform.defaults' => ['attributes' => ['stateless' => true]],
'api_platform.defaults' => ['attributes' => []],
'api_platform.openapi.termsOfService' => null,
'api_platform.openapi.contact.name' => null,
'api_platform.openapi.contact.url' => null,
Expand Down
6 changes: 0 additions & 6 deletions tests/Fixtures/app/config/config_common.yml
Expand Up @@ -66,11 +66,6 @@ api_platform:
collection:
order_parameter_name: 'order'
order: 'ASC'
pagination:
client_enabled: true
client_items_per_page: true
client_partial: true
items_per_page: 3
exception_to_status:
Symfony\Component\Serializer\Exception\ExceptionInterface: !php/const Symfony\Component\HttpFoundation\Response::HTTP_BAD_REQUEST
ApiPlatform\Core\Exception\InvalidArgumentException: !php/const Symfony\Component\HttpFoundation\Response::HTTP_BAD_REQUEST
Expand All @@ -89,7 +84,6 @@ api_platform:
shared_max_age: 3600
vary: ['Accept', 'Cookie']
public: true
stateless: true

parameters:
container.autowiring.strict_mode: true
Expand Down

0 comments on commit 70989f4

Please sign in to comment.