Skip to content

Commit 174bad0

Browse files
committed
fixes
1 parent 1229c38 commit 174bad0

File tree

5 files changed

+21
-16
lines changed

5 files changed

+21
-16
lines changed

src/Doctrine/Odm/Tests/PropertyInfo/DoctrineExtractorTest.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public function testExtractWithEmbedOneLegacy(): void
9696
if (!class_exists(LegacyType::class)) {
9797
$this->markTestSkipped();
9898
}
99+
99100
$expectedTypes = [
100101
new LegacyType(
101102
LegacyType::BUILTIN_TYPE_OBJECT,
@@ -126,6 +127,7 @@ public function testExtractWithEmbedManyLegacy(): void
126127
if (!class_exists(LegacyType::class)) {
127128
$this->markTestSkipped();
128129
}
130+
129131
$expectedTypes = [
130132
new LegacyType(
131133
LegacyType::BUILTIN_TYPE_OBJECT,
@@ -159,6 +161,7 @@ public function testExtractEnumLegacy(): void
159161
if (!class_exists(LegacyType::class)) {
160162
$this->markTestSkipped();
161163
}
164+
162165
$this->assertEquals([new LegacyType(LegacyType::BUILTIN_TYPE_OBJECT, false, EnumString::class)], $this->createExtractor()->getTypes(DoctrineEnum::class, 'enumString'));
163166
$this->assertEquals([new LegacyType(LegacyType::BUILTIN_TYPE_OBJECT, false, EnumInt::class)], $this->createExtractor()->getTypes(DoctrineEnum::class, 'enumInt'));
164167
$this->assertNull($this->createExtractor()->getTypes(DoctrineEnum::class, 'enumCustom'));
@@ -200,7 +203,8 @@ public function testExtractLegacy(): void
200203
['objectId', [new LegacyType(LegacyType::BUILTIN_TYPE_STRING)]],
201204
['raw', null],
202205
['foo', [new LegacyType(LegacyType::BUILTIN_TYPE_OBJECT, false, DoctrineRelation::class)]],
203-
['bar',
206+
[
207+
'bar',
204208
[
205209
new LegacyType(
206210
LegacyType::BUILTIN_TYPE_OBJECT,
@@ -212,7 +216,8 @@ public function testExtractLegacy(): void
212216
),
213217
],
214218
],
215-
['indexedFoo',
219+
[
220+
'indexedFoo',
216221
[
217222
new LegacyType(
218223
LegacyType::BUILTIN_TYPE_OBJECT,
@@ -228,7 +233,7 @@ public function testExtractLegacy(): void
228233
['notMapped', null],
229234
];
230235

231-
foreach ($legacyTypes as $t) {
236+
foreach ($legacyTypes as $property => $t) {
232237
$this->assertEquals($t, $this->createExtractor()->getTypes(DoctrineDummy::class, $property));
233238
}
234239
}
@@ -276,6 +281,7 @@ public function testGetTypesCatchExceptionLegacy(): void
276281
if (!class_exists(LegacyType::class)) {
277282
$this->markTestSkipped();
278283
}
284+
279285
$this->assertNull($this->createExtractor()->getTypes('Not\Exist', 'baz'));
280286
}
281287

@@ -299,6 +305,7 @@ public function testGetTypesWithEmbedManyOmittingTargetDocumentLegacy(): void
299305
if (!class_exists(LegacyType::class)) {
300306
$this->markTestSkipped();
301307
}
308+
302309
$actualTypes = $this->createExtractor()->getTypes(
303310
DoctrineWithEmbedded::class,
304311
'embedManyOmittingTargetDocument'

src/GraphQl/Serializer/SerializerContextBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,6 @@ private function denormalizePropertyName(string $property, ?string $resourceClas
111111
return $property;
112112
}
113113

114-
return $this->nameConverter->denormalize($property, $resourceClass, null, $context); // @phpstan-ignore-line
114+
return $this->nameConverter->denormalize($property, $resourceClass, null, $context);
115115
}
116116
}

src/State/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
"psr/container": "^1.0 || ^2.0",
3333
"symfony/http-kernel": "^6.4 || ^7.0 || ^8.0",
3434
"symfony/serializer": "^6.4 || ^7.0 || ^8.0",
35-
"symfony/translation-contracts": "^3.0"
35+
"symfony/translation-contracts": "^3.0",
36+
"symfony/deprecation-contracts": "^3.1"
3637
},
3738
"require-dev": {
3839
"api-platform/serializer": "^4.2.4",

src/Symfony/Validator/Serializer/ValidationExceptionNormalizer.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
namespace ApiPlatform\Symfony\Validator\Serializer;
1515

1616
use ApiPlatform\Validator\Exception\ValidationException;
17-
use Symfony\Component\Serializer\NameConverter\MetadataAwareNameConverter;
1817
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
1918
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
2019

@@ -30,10 +29,8 @@ public function normalize(mixed $object, ?string $format = null, array $context
3029
foreach ($object->getConstraintViolationList() as $violation) {
3130
$class = \is_object($root = $violation->getRoot()) ? $root::class : null;
3231

33-
if ($this->nameConverter instanceof MetadataAwareNameConverter) {
32+
if ($this->nameConverter) {
3433
$propertyPath = $this->nameConverter->normalize($violation->getPropertyPath(), $class, $format);
35-
} elseif ($this->nameConverter instanceof NameConverterInterface) {
36-
$propertyPath = $this->nameConverter->normalize($violation->getPropertyPath());
3734
} else {
3835
$propertyPath = $violation->getPropertyPath();
3936
}

tests/Fixtures/app/config/reference.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,8 @@
453453
* platform_service?: scalar|null, // Deprecated: The "platform_service" configuration key is deprecated since doctrine-bundle 2.9. DBAL 4 will not support setting a custom platform via connection params anymore.
454454
* auto_commit?: bool,
455455
* schema_filter?: scalar|null,
456-
* logging?: bool, // Default: false
457-
* profiling?: bool, // Default: false
456+
* logging?: bool, // Default: true
457+
* profiling?: bool, // Default: true
458458
* profiling_collect_backtrace?: bool, // Enables collecting backtraces when profiling is enabled // Default: false
459459
* profiling_collect_schema_errors?: bool, // Enables collecting schema errors when profiling is enabled // Default: true
460460
* disable_type_comments?: bool,
@@ -593,7 +593,7 @@
593593
* pool?: scalar|null,
594594
* },
595595
* region_lock_lifetime?: scalar|null, // Default: 60
596-
* log_enabled?: bool, // Default: false
596+
* log_enabled?: bool, // Default: true
597597
* region_lifetime?: scalar|null, // Default: 3600
598598
* enabled?: bool, // Default: true
599599
* factory?: scalar|null,
@@ -986,7 +986,7 @@
986986
* http_method_override?: bool, // Set true to enable support for the '_method' request parameter to determine the intended HTTP method on POST requests. // Default: false
987987
* allowed_http_method_override?: list<string>|null,
988988
* trust_x_sendfile_type_header?: scalar|null, // Set true to enable support for xsendfile in binary file responses. // Default: "%env(bool:default::SYMFONY_TRUST_X_SENDFILE_TYPE_HEADER)%"
989-
* ide?: scalar|null, // Default: null
989+
* ide?: scalar|null, // Default: "%env(default::SYMFONY_IDE)%"
990990
* test?: bool,
991991
* default_locale?: scalar|null, // Default: "en"
992992
* set_locale_from_accept_language?: bool, // Whether to use the Accept-Language HTTP header to set the Request locale (only when the "_locale" request attribute is not passed). // Default: false
@@ -1143,7 +1143,7 @@
11431143
* paths?: array<string, scalar|null>,
11441144
* excluded_patterns?: list<scalar|null>,
11451145
* exclude_dotfiles?: bool, // If true, any files starting with "." will be excluded from the asset mapper. // Default: true
1146-
* server?: bool, // If true, a "dev server" will return the assets from the public directory (true in "debug" mode only by default). // Default: false
1146+
* server?: bool, // If true, a "dev server" will return the assets from the public directory (true in "debug" mode only by default). // Default: true
11471147
* public_prefix?: scalar|null, // The public path where the assets will be written to (and served from when "server" is true). // Default: "/assets/"
11481148
* missing_import_mode?: "strict"|"warn"|"ignore", // Behavior if an asset cannot be found when imported from JavaScript or CSS files - e.g. "import './non-existent.js'". "strict" means an exception is thrown, "warn" means a warning is logged, "ignore" means the import is left as-is. // Default: "warn"
11491149
* extensions?: array<string, scalar|null>,
@@ -1263,7 +1263,7 @@
12631263
* },
12641264
* php_errors?: array{ // PHP errors handling configuration
12651265
* log?: mixed, // Use the application logger instead of the PHP logger for logging PHP errors. // Default: true
1266-
* throw?: bool, // Throw PHP errors as \ErrorException instances. // Default: false
1266+
* throw?: bool, // Throw PHP errors as \ErrorException instances. // Default: true
12671267
* },
12681268
* exceptions?: array<string, array{ // Default: []
12691269
* log_level?: scalar|null, // The level of log message. Null to let Symfony decide. // Default: null
@@ -1326,7 +1326,7 @@
13261326
* scheduler?: bool|array{ // Scheduler configuration
13271327
* enabled?: bool, // Default: false
13281328
* },
1329-
* disallow_search_engine_index?: bool, // Enabled by default when debug is enabled. // Default: false
1329+
* disallow_search_engine_index?: bool, // Enabled by default when debug is enabled. // Default: true
13301330
* http_client?: bool|array{ // HTTP Client configuration
13311331
* enabled?: bool, // Default: true
13321332
* max_host_connections?: int, // The maximum number of connections to a single host.

0 commit comments

Comments
 (0)