Skip to content

Commit 5c51f0c

Browse files
committed
behat
1 parent deb3a64 commit 5c51f0c

File tree

9 files changed

+25
-43
lines changed

9 files changed

+25
-43
lines changed

.php-cs-fixer.dist.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
'docs/guides',
2222
'docs/var',
2323
'src/Doctrine/Orm/Tests/var',
24-
'src/Doctrine/Odm/Tests/var'
24+
'src/Doctrine/Odm/Tests/var',
25+
'tests/Fixtures/app/config/reference.php'
2526
])
2627
->notPath('src/Symfony/Bundle/DependencyInjection/Configuration.php')
2728
->append([

src/Laravel/Routing/SkolemIriConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function getResourceFromIri(string $iri, array $context = [], ?Operation
5656
public function getIriFromResource(object|string $resource, int $referenceType = UrlGeneratorInterface::ABS_PATH, ?Operation $operation = null, array $context = []): string
5757
{
5858
$referenceType = $operation ? ($operation->getUrlGenerationStrategy() ?? $referenceType) : $referenceType;
59-
if (($isObject = \is_object($resource)) && $this->objectHashMap->contains($resource)) {
59+
if (($isObject = \is_object($resource)) && $this->objectHashMap->offsetExists($resource)) {
6060
return $this->router->generate('api_genid', ['id' => $this->objectHashMap[$resource]], $referenceType);
6161
}
6262

src/Symfony/Bundle/Resources/config/json_streamer/common.php

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,44 +13,39 @@
1313

1414
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
1515

16+
use ApiPlatform\JsonLd\JsonStreamer\ValueTransformer\ContextValueTransformer;
17+
use ApiPlatform\JsonLd\JsonStreamer\ValueTransformer\IriValueTransformer;
18+
use ApiPlatform\JsonLd\JsonStreamer\ValueTransformer\TypeValueTransformer;
19+
use ApiPlatform\JsonLd\JsonStreamer\WritePropertyMetadataLoader;
20+
1621
return function (ContainerConfigurator $container) {
1722
$services = $container->services();
1823

19-
$services->set('api_platform.jsonld.json_streamer.stream_writer', 'Symfony\Component\JsonStreamer\JsonStreamWriter')
20-
->args([
21-
tagged_locator('json_streamer.value_transformer'),
22-
service('api_platform.jsonld.json_streamer.write.property_metadata_loader'),
23-
'%.json_streamer.stream_writers_dir.jsonld%',
24-
]);
25-
26-
$services->set('api_platform.jsonld.json_streamer.stream_reader', 'Symfony\Component\JsonStreamer\JsonStreamReader')
27-
->args([
28-
tagged_locator('json_streamer.value_transformer'),
29-
service('json_streamer.read.property_metadata_loader'),
30-
'%.json_streamer.stream_readers_dir.jsonld%',
31-
'%.json_streamer.lazy_ghosts_dir.jsonld%',
32-
]);
24+
$services->alias('api_platform.jsonld.json_streamer.stream_writer', 'json_streamer.stream_writer');
25+
$services->alias('api_platform.jsonld.json_streamer.stream_reader', 'json_streamer.stream_reader');
3326

34-
$services->set('api_platform.jsonld.json_streamer.write.property_metadata_loader', 'ApiPlatform\JsonLd\JsonStreamer\WritePropertyMetadataLoader')
27+
$services->set('api_platform.jsonld.json_streamer.write.property_metadata_loader', WritePropertyMetadataLoader::class)
28+
->decorate('json_streamer.write.property_metadata_loader')
3529
->args([
36-
service('json_streamer.write.property_metadata_loader'),
30+
service('.inner'),
3731
service('api_platform.resource_class_resolver'),
3832
service('api_platform.metadata.property.name_collection_factory'),
3933
service('api_platform.metadata.property.metadata_factory'),
4034
]);
4135

42-
$services->set('api_platform.jsonld.json_streamer.write.value_transformer.iri', 'ApiPlatform\JsonLd\JsonStreamer\ValueTransformer\IriValueTransformer')
36+
// Value transformers
37+
$services->set('api_platform.jsonld.json_streamer.write.value_transformer.iri', IriValueTransformer::class)
4338
->args([service('api_platform.iri_converter')])
4439
->tag('json_streamer.value_transformer');
4540

46-
$services->set('api_platform.jsonld.json_streamer.write.value_transformer.type', 'ApiPlatform\JsonLd\JsonStreamer\ValueTransformer\TypeValueTransformer')
41+
$services->set('api_platform.jsonld.json_streamer.write.value_transformer.type', TypeValueTransformer::class)
4742
->args([
4843
service('api_platform.resource_class_resolver'),
4944
service('api_platform.metadata.resource.metadata_collection_factory'),
5045
])
5146
->tag('json_streamer.value_transformer');
5247

53-
$services->set('api_platform.jsonld.json_streamer.write.value_transformer.context', 'ApiPlatform\JsonLd\JsonStreamer\ValueTransformer\ContextValueTransformer')
48+
$services->set('api_platform.jsonld.json_streamer.write.value_transformer.context', ContextValueTransformer::class)
5449
->args([service('api_platform.router')])
5550
->tag('json_streamer.value_transformer');
5651
};

src/Symfony/Routing/SkolemIriConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function getResourceFromIri(string $iri, array $context = [], ?Operation
5252
public function getIriFromResource(object|string $resource, int $referenceType = UrlGeneratorInterface::ABS_PATH, ?Operation $operation = null, array $context = []): string
5353
{
5454
$referenceType = $operation ? ($operation->getUrlGenerationStrategy() ?? $referenceType) : $referenceType;
55-
if (($isObject = \is_object($resource)) && $this->objectHashMap->contains($resource)) {
55+
if (($isObject = \is_object($resource)) && $this->objectHashMap->offsetExists($resource)) {
5656
return $this->router->generate('api_genid', ['id' => $this->objectHashMap[$resource]], $referenceType);
5757
}
5858

tests/Fixtures/TestBundle/ApiResource/ValidateParameterBeforeProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
uriTemplate: 'query_parameter_validate_before_read',
2626
parameters: [
2727
'search' => new QueryParameter(constraints: [new NotBlank()]),
28-
'sort[:property]' => new QueryParameter(constraints: [new NotBlank(), new Collection(['id' => new Choice(['asc', 'desc'])], allowMissingFields: true)]),
28+
'sort[:property]' => new QueryParameter(constraints: [new NotBlank(), new Collection(['id' => new Choice(choices: ['asc', 'desc'])], allowMissingFields: true)]),
2929
],
3030
provider: [self::class, 'provide']
3131
)]

tests/Fixtures/TestBundle/Security/SecuredDummyAttributeBasedVoter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
namespace ApiPlatform\Tests\Fixtures\TestBundle\Security;
1515

1616
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
17+
use Symfony\Component\Security\Core\Authorization\Voter\Vote;
1718
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
1819
use Symfony\Component\Security\Core\User\UserInterface;
1920

@@ -38,7 +39,7 @@ protected function supports(string $attribute, mixed $subject): bool
3839
return \in_array($subject, array_keys(self::RBAC), true);
3940
}
4041

41-
protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token): bool
42+
protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token, ?Vote $vote = null): bool
4243
{
4344
$user = $token->getUser();
4445
if (!$user instanceof UserInterface || !\is_string($subject)) {

tests/Fixtures/app/config/reference.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
<?php
22

3-
/*
4-
* This file is part of the API Platform project.
5-
*
6-
* (c) Kévin Dunglas <[email protected]>
7-
*
8-
* For the full copyright and license information, please view the LICENSE
9-
* file that was distributed with this source code.
10-
*/
11-
12-
declare(strict_types=1);
13-
143
// This file is auto-generated and is for apps only. Bundles SHOULD NOT rely on its content.
154

165
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
@@ -398,7 +387,6 @@
398387
* }>,
399388
* autoescape_service?: scalar|null, // Default: null
400389
* autoescape_service_method?: scalar|null, // Default: null
401-
* base_template_class?: scalar|null, // Deprecated: The child node "base_template_class" at path "twig.base_template_class" is deprecated.
402390
* cache?: scalar|null, // Default: true
403391
* charset?: scalar|null, // Default: "%kernel.charset%"
404392
* debug?: bool, // Default: "%kernel.debug%"
@@ -675,7 +663,6 @@
675663
* @psalm-type SecurityConfig = array{
676664
* access_denied_url?: scalar|null, // Default: null
677665
* session_fixation_strategy?: "none"|"migrate"|"invalidate", // Default: "migrate"
678-
* hide_user_not_found?: bool, // Deprecated: The "hide_user_not_found" option is deprecated and will be removed in 8.0. Use the "expose_security_errors" option instead.
679666
* expose_security_errors?: \Symfony\Component\Security\Http\Authentication\ExposeSecurityLevel::None|\Symfony\Component\Security\Http\Authentication\ExposeSecurityLevel::AccountStatus|\Symfony\Component\Security\Http\Authentication\ExposeSecurityLevel::All, // Default: "none"
680667
* erase_credentials?: bool, // Default: true
681668
* access_decision_manager?: array{
@@ -916,9 +903,7 @@
916903
* claim?: scalar|null, // Claim which contains the user identifier (e.g.: sub, email..). // Default: "sub"
917904
* audience: scalar|null, // Audience set in the token, for validation purpose.
918905
* issuers: list<scalar|null>,
919-
* algorithm?: array<mixed>,
920906
* algorithms: list<scalar|null>,
921-
* key?: scalar|null, // Deprecated: The "key" option is deprecated and will be removed in 8.0. Use the "keyset" option instead. // JSON-encoded JWK used to sign the token (must contain a "kty" key).
922907
* keyset?: scalar|null, // JSON-encoded JWKSet used to sign the token (must contain a list of valid public keys).
923908
* encryption?: bool|array{
924909
* enabled?: bool, // Default: false

tests/Fixtures/app/config/routing_mongodb.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ controller:
66
type: attribute
77

88
web_profiler_wdt:
9-
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
9+
resource: '@WebProfilerBundle/Resources/config/routing/wdt.php'
1010
prefix: /_wdt
1111

1212
web_profiler_profiler:
13-
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
13+
resource: '@WebProfilerBundle/Resources/config/routing/profiler.php'
1414
prefix: /_profiler

tests/Fixtures/app/config/routing_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ controller:
66
type: attribute
77

88
web_profiler_wdt:
9-
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
9+
resource: '@WebProfilerBundle/Resources/config/routing/wdt.php'
1010
prefix: /_wdt
1111

1212
web_profiler_profiler:
13-
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
13+
resource: '@WebProfilerBundle/Resources/config/routing/profiler.php'
1414
prefix: /_profiler

0 commit comments

Comments
 (0)