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

Commitf875bdb

Browse files
committed
[Serializer] Re-addAdvancedNameConverterInterface as deprecated
1 parent180f389 commitf875bdb

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* Gives access to the class, the format and the context in the property name converters.
1616
*
1717
* @author Kévin Dunglas <dunglas@gmail.com>
18+
*
19+
* @deprecated since Symfony 7.1, use NameConverterInterface instead
1820
*/
1921
interface AdvancedNameConverterInterfaceextends NameConverterInterface
2022
{

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* @author Kévin Dunglas <dunglas@gmail.com>
2020
* @author Aurélien Pillevesse <aurelienpillevesse@hotmail.fr>
2121
*/
22-
class CamelCaseToSnakeCaseNameConverterimplements NameConverterInterface
22+
class CamelCaseToSnakeCaseNameConverterimplements NameConverterInterface, AdvancedNameConverterInterface
2323
{
2424
/**
2525
* Require all properties to be written in snake_case.
@@ -41,7 +41,7 @@ public function __construct(
4141
* @param string|null $format
4242
* @param array<string, mixed> $context
4343
*/
44-
publicfunctionnormalize(string$propertyName/*, ?string $class = null, ?string $format = null, array $context = [] */):string
44+
publicfunctionnormalize(string$propertyName, ?string$class =null, ?string$format =null,array$context = []):string
4545
{
4646
if (null ===$this->attributes ||\in_array($propertyName,$this->attributes,true)) {
4747
returnstrtolower(preg_replace('/[A-Z]/','_\\0',lcfirst($propertyName)));
@@ -55,12 +55,8 @@ public function normalize(string $propertyName/* , ?string $class = null, ?strin
5555
* @param string|null $format
5656
* @param array<string, mixed> $context
5757
*/
58-
publicfunctiondenormalize(string$propertyName/*, ?string $class = null, ?string $format = null, array $context = [] */):string
58+
publicfunctiondenormalize(string$propertyName, ?string$class =null, ?string$format =null,array$context = []):string
5959
{
60-
$class =1 <\func_num_args() ?func_get_arg(1) :null;
61-
$format =2 <\func_num_args() ?func_get_arg(2) :null;
62-
$context =3 <\func_num_args() ?func_get_arg(3) : [];
63-
6460
if (($context[self::REQUIRE_SNAKE_CASE_PROPERTIES] ??false) &&$propertyName !==$this->normalize($propertyName,$class,$format,$context)) {
6561
thrownewUnexpectedPropertyException($propertyName);
6662
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/**
1919
* @author Fabien Bourigault <bourigaultfabien@gmail.com>
2020
*/
21-
finalclass MetadataAwareNameConverterimplements NameConverterInterface
21+
finalclass MetadataAwareNameConverterimplements NameConverterInterface, AdvancedNameConverterInterface
2222
{
2323
/**
2424
* @var array<string, array<string, string|null>>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp