Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcedfa9c

Browse files
committed
Change visibility of getNormalizer and getDenormalizer
1 parent934aea0 commitcedfa9c

File tree

3 files changed

+21
-17
lines changed

3 files changed

+21
-17
lines changed

‎src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ interface DenormalizerInterface
4848
*/
4949
publicfunctiondenormalize(mixed$data,string$type,string$format =null,array$context = []);
5050

51+
/**
52+
* Returns a matching denormalizer.
53+
*
54+
* @param mixed $data Data to restore
55+
* @param string $class The expected class to instantiate
56+
* @param string|null $format Format name, present to give the option to normalizers to act differently based on formats
57+
* @param array $context Options available to the denormalizer
58+
*/
59+
publicfunctiongetDenormalizer(mixed$data,string$class, ?string$format,array$context): ?DenormalizerInterface;
60+
5161
/**
5262
* Checks whether the given class is supported for denormalization by this normalizer.
5363
*

‎src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ interface NormalizerInterface
4040
*/
4141
publicfunctionnormalize(mixed$object,string$format =null,array$context = []);
4242

43+
/**
44+
* Returns a matching normalizer.
45+
*
46+
* @param mixed $data Data to get the serializer for
47+
* @param string|null $format Format name, present to give the option to normalizers to act differently based on formats
48+
* @param array $context Options available to the normalizer
49+
*/
50+
publicfunctiongetNormalizer(mixed$data, ?string$format,array$context): ?NormalizerInterface;
51+
4352
/**
4453
* Checks whether the given class is supported for normalization by this normalizer.
4554
*

‎src/Symfony/Component/Serializer/Serializer.php‎

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,7 @@ public function supportsDenormalization(mixed $data, string $type, string $forma
249249
returnisset(self::SCALAR_TYPES[$type]) ||null !==$this->getDenormalizer($data,$type,$format,$context);
250250
}
251251

252-
/**
253-
* Returns a matching normalizer.
254-
*
255-
* @param mixed $data Data to get the serializer for
256-
* @param string|null $format Format name, present to give the option to normalizers to act differently based on formats
257-
* @param array $context Options available to the normalizer
258-
*/
259-
privatefunctiongetNormalizer(mixed$data, ?string$format,array$context): ?NormalizerInterface
252+
publicfunctiongetNormalizer(mixed$data, ?string$format,array$context): ?NormalizerInterface
260253
{
261254
if (\is_object($data)) {
262255
$type =$data::class;
@@ -325,15 +318,7 @@ private function getNormalizer(mixed $data, ?string $format, array $context): ?N
325318
returnnull;
326319
}
327320

328-
/**
329-
* Returns a matching denormalizer.
330-
*
331-
* @param mixed $data Data to restore
332-
* @param string $class The expected class to instantiate
333-
* @param string|null $format Format name, present to give the option to normalizers to act differently based on formats
334-
* @param array $context Options available to the denormalizer
335-
*/
336-
privatefunctiongetDenormalizer(mixed$data,string$class, ?string$format,array$context): ?DenormalizerInterface
321+
publicfunctiongetDenormalizer(mixed$data,string$class, ?string$format,array$context): ?DenormalizerInterface
337322
{
338323
if (!isset($this->denormalizerCache[$format][$class])) {
339324
$this->denormalizerCache[$format][$class] = [];

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp