Skip to content

Commit 7b9bb36

Browse files
committed
[Serializer] Fix CS
1 parent 249ec6a commit 7b9bb36

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

src/Symfony/Component/Serializer/NameConverter/CamelCaseToUnderscoreNameConverter.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Serializer\NameConverter;
1313

14-
1514
/**
1615
* CamelCase to Underscore name converter.
1716
*

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

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,10 @@ abstract class AbstractNormalizer extends SerializerAwareNormalizer implements N
3232
/**
3333
* Sets the {@link ClassMetadataFactory} to use.
3434
*
35-
* @param ClassMetadataFactory $classMetadataFactory
36-
* @param NameConverterInterface $nameConverter
35+
* @param ClassMetadataFactory|null $classMetadataFactory
36+
* @param NameConverterInterface|null $nameConverter
3737
*/
38-
public function __construct(
39-
ClassMetadataFactory $classMetadataFactory = null,
40-
NameConverterInterface $nameConverter = null
41-
)
42-
{
38+
public function __construct(ClassMetadataFactory $classMetadataFactory = null, NameConverterInterface $nameConverter = null) {
4339
$this->classMetadataFactory = $classMetadataFactory;
4440
$this->nameConverter = $nameConverter;
4541
}
@@ -85,21 +81,21 @@ public function setIgnoredAttributes(array $ignoredAttributes)
8581
/**
8682
* Set attributes to be camelized on denormalize.
8783
*
88-
* @deprecated since 2.7, to be removed in 3.0. Use Symfony\Component\Serializer\Naming\CamelCaseToUnderscoreNameConverter instead.
84+
* @deprecated since 2.7, to be removed in 3.0. Use Symfony\Component\Serializer\NameConverter\CamelCaseToUnderscoreNameConverter instead.
8985
*
9086
* @param array $camelizedAttributes
9187
*
9288
* @return self
9389
*/
9490
public function setCamelizedAttributes(array $camelizedAttributes)
9591
{
96-
trigger_error('The setCamelizedAttributes() has been deprecated. Use Symfony\Component\Serializer\Naming\CamelCaseToUnderscoreNameConverter instead.', E_USER_DEPRECATED);
92+
trigger_error('The setCamelizedAttributes() has been deprecated. Use Symfony\Component\Serializer\NameConverter\CamelCaseToUnderscoreNameConverter instead.', E_USER_DEPRECATED);
9793

9894
$attributes = array();
9995
foreach ($camelizedAttributes as $camelizedAttribute) {
100-
$attributes[] = lcfirst(preg_replace_callback('/(^|_|\.)+(.)/', function ($match) {
101-
return ('.' === $match[1] ? '_' : '').strtoupper($match[2]);
102-
}, $camelizedAttribute));
96+
$attributes[] = lcfirst(preg_replace_callback('/(^|_|\.)+(.)/', function ($match) {
97+
return ('.' === $match[1] ? '_' : '').strtoupper($match[2]);
98+
}, $camelizedAttribute));
10399
}
104100

105101
$this->nameConverter = new CamelCaseToUnderscoreNameConverter($attributes);

src/Symfony/Component/Serializer/Tests/NameConverter/CamelCaseToUnderscoreNameConverterTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*/
1111

1212
namespace Symfony\Component\Serializer\Tests\NameConverter;
13+
1314
use Symfony\Component\Serializer\NameConverter\CamelCaseToUnderscoreNameConverter;
1415

1516
/**

0 commit comments

Comments
 (0)