Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7c16836

Browse files
committed
Merge branch '6.4' into 7.1
* 6.4: [Serializer] Fix for method named `get()` [Notifier][TurboSMS] Process partial accepted response from transport [HttpClient] Fix setting CURLMOPT_MAXCONNECTS throw a meaningful exception when parsing dotenv files with BOM [FrameworkBundle] Fix schema & finish incomplete tests for lock & semaphore config [Cache] Fix RedisSentinel params types [FrameworkBundle] Fix service reset between tests [Uid][Serializer][Validator] Mention RFC 9562 make sure temp files can be cleaned up on Windows
2 parents 0158b0e + fed6cf3 commit 7c16836

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

Normalizer/ObjectNormalizer.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,19 @@ protected function extractAttributes(object $object, ?string $format = null, arr
8888
$name = $reflMethod->name;
8989
$attributeName = null;
9090

91-
if (str_starts_with($name, 'get') || str_starts_with($name, 'has') || str_starts_with($name, 'can')) {
91+
if (3 < \strlen($name) && match ($name[0]) {
92+
'g' => str_starts_with($name, 'get'),
93+
'h' => str_starts_with($name, 'has'),
94+
'c' => str_starts_with($name, 'can'),
95+
default => false,
96+
}) {
9297
// getters, hassers and canners
9398
$attributeName = substr($name, 3);
9499

95100
if (!$reflClass->hasProperty($attributeName)) {
96101
$attributeName = lcfirst($attributeName);
97102
}
98-
} elseif (str_starts_with($name, 'is')) {
103+
} elseif ('is' !== $name && str_starts_with($name, 'is')) {
99104
// issers
100105
$attributeName = substr($name, 2);
101106

Normalizer/UidNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ final class UidNormalizer implements NormalizerInterface, DenormalizerInterface
2222
public const NORMALIZATION_FORMAT_CANONICAL = 'canonical';
2323
public const NORMALIZATION_FORMAT_BASE58 = 'base58';
2424
public const NORMALIZATION_FORMAT_BASE32 = 'base32';
25-
public const NORMALIZATION_FORMAT_RFC4122 = 'rfc4122';
25+
public const NORMALIZATION_FORMAT_RFC4122 = 'rfc4122'; // RFC 9562 obsoleted RFC 4122 but the format is the same
2626
public const NORMALIZATION_FORMATS = [
2727
self::NORMALIZATION_FORMAT_CANONICAL,
2828
self::NORMALIZATION_FORMAT_BASE58,

0 commit comments

Comments
 (0)