Skip to content

Commit bb1664e

Browse files
Merge branch '5.4' into 6.4
* 5.4: [Messenger] Fix reading pending messages with Redis [Serializer] Revert symfony#54488 to fix BC Break [Validator] reviewed Polish translation for unit 113 [Validator] Missing translations for Croatian (hr) review and fix hungarian validation message Update translation review uk translations v2 [Validator] Update message translations for unit 113 (TLD) [Intl] Remove resources data from classmap generation
2 parents 711cf7b + 7bb819e commit bb1664e

Some content is hidden

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

65 files changed

+128
-344
lines changed

src/Symfony/Component/Intl/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"autoload": {
3535
"psr-4": { "Symfony\\Component\\Intl\\": "" },
3636
"exclude-from-classmap": [
37-
"/Tests/"
37+
"/Tests/",
38+
"/Resources/data/"
3839
]
3940
},
4041
"minimum-stability": "dev"

src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ private function claimOldPendingMessages(): void
330330
try {
331331
// This could soon be optimized with https://github.com/antirez/redis/issues/5212 or
332332
// https://github.com/antirez/redis/issues/6256
333-
$pendingMessages = $this->getRedis()->xpending($this->stream, $this->group, '-', '+', 1);
333+
$pendingMessages = $this->getRedis()->xpending($this->stream, $this->group, '-', '+', 1) ?: [];
334334
} catch (\RedisException|\Relay\Exception $e) {
335335
throw new TransportException($e->getMessage(), 0, $e);
336336
}

src/Symfony/Component/Serializer/Mapping/Loader/AttributeLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function loadClassMetadata(ClassMetadataInterface $classMetadata): bool
130130

131131
$accessorOrMutator = preg_match('/^(get|is|has|set)(.+)$/i', $method->name, $matches);
132132
if ($accessorOrMutator) {
133-
$attributeName = $reflectionClass->hasProperty($method->name) ? $method->name : lcfirst($matches[2]);
133+
$attributeName = lcfirst($matches[2]);
134134

135135
if (isset($attributesMetadata[$attributeName])) {
136136
$attributeMetadata = $attributesMetadata[$attributeName];

src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,25 +98,17 @@ protected function extractAttributes(object $object, ?string $format = null, arr
9898

9999
if (str_starts_with($name, 'get') || str_starts_with($name, 'has') || str_starts_with($name, 'can')) {
100100
// getters, hassers and canners
101-
$attributeName = $name;
101+
$attributeName = substr($name, 3);
102102

103103
if (!$reflClass->hasProperty($attributeName)) {
104-
$attributeName = substr($attributeName, 3);
105-
106-
if (!$reflClass->hasProperty($attributeName)) {
107-
$attributeName = lcfirst($attributeName);
108-
}
104+
$attributeName = lcfirst($attributeName);
109105
}
110106
} elseif (str_starts_with($name, 'is')) {
111107
// issers
112-
$attributeName = $name;
108+
$attributeName = substr($name, 2);
113109

114110
if (!$reflClass->hasProperty($attributeName)) {
115-
$attributeName = substr($attributeName, 2);
116-
117-
if (!$reflClass->hasProperty($attributeName)) {
118-
$attributeName = lcfirst($attributeName);
119-
}
111+
$attributeName = lcfirst($attributeName);
120112
}
121113
}
122114

src/Symfony/Component/Serializer/Tests/Fixtures/SamePropertyAsMethodDummy.php

Lines changed: 0 additions & 48 deletions
This file was deleted.

src/Symfony/Component/Serializer/Tests/Fixtures/SamePropertyAsMethodWithMethodSerializedNameDummy.php

Lines changed: 0 additions & 54 deletions
This file was deleted.

src/Symfony/Component/Serializer/Tests/Fixtures/SamePropertyAsMethodWithPropertySerializedNameDummy.php

Lines changed: 0 additions & 57 deletions
This file was deleted.

src/Symfony/Component/Serializer/Tests/Normalizer/ObjectNormalizerTest.php

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@
4343
use Symfony\Component\Serializer\Tests\Fixtures\Php74Dummy;
4444
use Symfony\Component\Serializer\Tests\Fixtures\Php74DummyPrivate;
4545
use Symfony\Component\Serializer\Tests\Fixtures\Php80Dummy;
46-
use Symfony\Component\Serializer\Tests\Fixtures\SamePropertyAsMethodDummy;
47-
use Symfony\Component\Serializer\Tests\Fixtures\SamePropertyAsMethodWithMethodSerializedNameDummy;
48-
use Symfony\Component\Serializer\Tests\Fixtures\SamePropertyAsMethodWithPropertySerializedNameDummy;
4946
use Symfony\Component\Serializer\Tests\Fixtures\SiblingHolder;
5047
use Symfony\Component\Serializer\Tests\Normalizer\Features\AttributesTestTrait;
5148
use Symfony\Component\Serializer\Tests\Normalizer\Features\CacheableObjectAttributesTestTrait;
@@ -855,53 +852,6 @@ public function testNormalizeStdClass()
855852
$this->assertSame(['baz' => 'baz'], $this->normalizer->normalize($o2));
856853
}
857854

858-
public function testSamePropertyAsMethod()
859-
{
860-
$object = new SamePropertyAsMethodDummy('free_trial', 'has_subscribe', 'get_ready', 'is_active');
861-
$expected = [
862-
'freeTrial' => 'free_trial',
863-
'hasSubscribe' => 'has_subscribe',
864-
'getReady' => 'get_ready',
865-
'isActive' => 'is_active',
866-
];
867-
868-
$this->assertSame($expected, $this->normalizer->normalize($object));
869-
}
870-
871-
public function testSamePropertyAsMethodWithPropertySerializedName()
872-
{
873-
$classMetadataFactory = new ClassMetadataFactory(new AttributeLoader());
874-
$this->normalizer = new ObjectNormalizer($classMetadataFactory, new MetadataAwareNameConverter($classMetadataFactory));
875-
$this->normalizer->setSerializer($this->serializer);
876-
877-
$object = new SamePropertyAsMethodWithPropertySerializedNameDummy('free_trial', 'has_subscribe', 'get_ready', 'is_active');
878-
$expected = [
879-
'free_trial_property' => 'free_trial',
880-
'has_subscribe_property' => 'has_subscribe',
881-
'get_ready_property' => 'get_ready',
882-
'is_active_property' => 'is_active',
883-
];
884-
885-
$this->assertSame($expected, $this->normalizer->normalize($object));
886-
}
887-
888-
public function testSamePropertyAsMethodWithMethodSerializedName()
889-
{
890-
$classMetadataFactory = new ClassMetadataFactory(new AttributeLoader());
891-
$this->normalizer = new ObjectNormalizer($classMetadataFactory, new MetadataAwareNameConverter($classMetadataFactory));
892-
$this->normalizer->setSerializer($this->serializer);
893-
894-
$object = new SamePropertyAsMethodWithMethodSerializedNameDummy('free_trial', 'has_subscribe', 'get_ready', 'is_active');
895-
$expected = [
896-
'free_trial_method' => 'free_trial',
897-
'has_subscribe_method' => 'has_subscribe',
898-
'get_ready_method' => 'get_ready',
899-
'is_active_method' => 'is_active',
900-
];
901-
902-
$this->assertSame($expected, $this->normalizer->normalize($object));
903-
}
904-
905855
public function testNormalizeWithIgnoreAttributeAndPrivateProperties()
906856
{
907857
$classMetadataFactory = new ClassMetadataFactory(new AttributeLoader());

src/Symfony/Component/Validator/Resources/translations/validators.af.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,8 @@
439439
<target state="needs-review-translation">Hierdie waarde is nie 'n geldige MAC-adres nie.</target>
440440
</trans-unit>
441441
<trans-unit id="113">
442-
<source>This URL does not contain a TLD.</source>
443-
<target state="needs-review-translation">Hierdie URL bevat nie 'n topvlakdomein (TLD) nie.</target>
442+
<source>This URL is missing a top-level domain.</source>
443+
<target state="needs-review-translation">Die URL mis 'n topvlakdomein.</target>
444444
</trans-unit>
445445
</body>
446446
</file>

src/Symfony/Component/Validator/Resources/translations/validators.ar.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,8 @@
439439
<target>هذه القيمة ليست عنوان MAC صالحًا.</target>
440440
</trans-unit>
441441
<trans-unit id="113">
442-
<source>This URL does not contain a TLD.</source>
443-
<target state="needs-review-translation">هذا الرابط لا يحتوي على نطاق أعلى مستوى (TLD).</target>
442+
<source>This URL is missing a top-level domain.</source>
443+
<target state="needs-review-translation">هذا الرابط يفتقر إلى نطاق أعلى مستوى.</target>
444444
</trans-unit>
445445
</body>
446446
</file>

0 commit comments

Comments
 (0)