Skip to content

Commit 830bc47

Browse files
Merge branch '4.4' into 5.4
* 4.4: CS fixes Bump Symfony version to 4.4.44 Update VERSION for 4.4.43 Update CONTRIBUTORS for 4.4.43 Update CHANGELOG for 4.4.43
2 parents dc554d7 + 68ce84e commit 830bc47

File tree

6 files changed

+30
-30
lines changed

6 files changed

+30
-30
lines changed

Encoder/XmlEncoder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function encode($data, string $format, array $context = [])
8383

8484
$dom = $this->createDomDocument($context);
8585

86-
if (null !== $data && !is_scalar($data)) {
86+
if (null !== $data && !\is_scalar($data)) {
8787
$root = $dom->createElement($xmlRootNodeName);
8888
$dom->appendChild($root);
8989
$this->buildXml($root, $data, $format, $context, $xmlRootNodeName);
@@ -367,9 +367,9 @@ private function buildXml(\DOMNode $parentNode, $data, string $format, array $co
367367

368368
if (\is_array($data) || ($data instanceof \Traversable && (null === $this->serializer || !$this->serializer->supportsNormalization($data, $format)))) {
369369
foreach ($data as $key => $data) {
370-
//Ah this is the magic @ attribute types.
370+
// Ah this is the magic @ attribute types.
371371
if (str_starts_with($key, '@') && $this->isElementNameValid($attributeName = substr($key, 1))) {
372-
if (!is_scalar($data)) {
372+
if (!\is_scalar($data)) {
373373
$data = $this->serializer->normalize($data, $format, $context);
374374
}
375375
$parentNode->setAttribute($attributeName, $data);
@@ -409,7 +409,7 @@ private function buildXml(\DOMNode $parentNode, $data, string $format, array $co
409409
}
410410

411411
$data = $this->serializer->normalize($data, $format, $context);
412-
if (null !== $data && !is_scalar($data)) {
412+
if (null !== $data && !\is_scalar($data)) {
413413
return $this->buildXml($parentNode, $data, $format, $context, $xmlRootNodeName);
414414
}
415415

@@ -434,7 +434,7 @@ private function buildXml(\DOMNode $parentNode, $data, string $format, array $co
434434
*/
435435
private function appendNode(\DOMNode $parentNode, $data, string $format, array $context, string $nodeName, string $key = null): bool
436436
{
437-
$dom = $parentNode instanceof \DomDocument ? $parentNode : $parentNode->ownerDocument;
437+
$dom = $parentNode instanceof \DOMDocument ? $parentNode : $parentNode->ownerDocument;
438438
$node = $dom->createElement($nodeName);
439439
if (null !== $key) {
440440
$node->setAttribute('key', $key);

Normalizer/AbstractNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ protected function getGroups(array $context): array
259259
{
260260
$groups = $context[self::GROUPS] ?? $this->defaultContext[self::GROUPS] ?? [];
261261

262-
return is_scalar($groups) ? (array) $groups : $groups;
262+
return \is_scalar($groups) ? (array) $groups : $groups;
263263
}
264264

265265
/**

Normalizer/AbstractObjectNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public function normalize($object, string $format = null, array $context = [])
198198

199199
$attributeValue = $this->applyCallbacks($attributeValue, $object, $attribute, $format, $attributeContext);
200200

201-
if (null !== $attributeValue && !is_scalar($attributeValue)) {
201+
if (null !== $attributeValue && !\is_scalar($attributeValue)) {
202202
$stack[$attribute] = $attributeValue;
203203
}
204204

Serializer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function normalize($data, string $format = null, array $context = [])
161161
return $normalizer->normalize($data, $format, $context);
162162
}
163163

164-
if (null === $data || is_scalar($data)) {
164+
if (null === $data || \is_scalar($data)) {
165165
return $data;
166166
}
167167

Tests/DeserializeNestedArrayOfObjectsTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ class DeserializeNestedArrayOfObjectsTest extends TestCase
2323
public function provider()
2424
{
2525
return [
26-
//from property PhpDoc
26+
// from property PhpDoc
2727
[Zoo::class],
28-
//from argument constructor PhpDoc
28+
// from argument constructor PhpDoc
2929
[ZooImmutable::class],
3030
];
3131
}
@@ -35,7 +35,7 @@ public function provider()
3535
*/
3636
public function testPropertyPhpDoc($class)
3737
{
38-
//GIVEN
38+
// GIVEN
3939
$json = <<<EOF
4040
{
4141
"animals": [
@@ -47,10 +47,10 @@ public function testPropertyPhpDoc($class)
4747
new ObjectNormalizer(null, null, null, new PhpDocExtractor()),
4848
new ArrayDenormalizer(),
4949
], ['json' => new JsonEncoder()]);
50-
//WHEN
50+
// WHEN
5151
/** @var Zoo $zoo */
5252
$zoo = $serializer->deserialize($json, $class, 'json');
53-
//THEN
53+
// THEN
5454
self::assertCount(1, $zoo->getAnimals());
5555
self::assertInstanceOf(Animal::class, $zoo->getAnimals()[0]);
5656
}

Tests/SerializerTest.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public function testSerializeEmpty()
219219
$serializer = new Serializer([new ObjectNormalizer()], ['json' => new JsonEncoder()]);
220220
$data = ['foo' => new \stdClass()];
221221

222-
//Old buggy behaviour
222+
// Old buggy behaviour
223223
$result = $serializer->serialize($data, 'json');
224224
$this->assertEquals('{"foo":[]}', $result);
225225

@@ -528,14 +528,14 @@ public function testNotNormalizableValueExceptionMessageForAResource()
528528
public function testNormalizeTransformEmptyArrayObjectToArray()
529529
{
530530
$serializer = new Serializer(
531-
[
532-
new PropertyNormalizer(),
533-
new ObjectNormalizer(),
534-
new ArrayDenormalizer(),
535-
],
536-
[
537-
'json' => new JsonEncoder(),
538-
]
531+
[
532+
new PropertyNormalizer(),
533+
new ObjectNormalizer(),
534+
new ArrayDenormalizer(),
535+
],
536+
[
537+
'json' => new JsonEncoder(),
538+
]
539539
);
540540

541541
$object = [];
@@ -551,14 +551,14 @@ public function testNormalizeTransformEmptyArrayObjectToArray()
551551
public function provideObjectOrCollectionTests()
552552
{
553553
$serializer = new Serializer(
554-
[
555-
new PropertyNormalizer(),
556-
new ObjectNormalizer(),
557-
new ArrayDenormalizer(),
558-
],
559-
[
560-
'json' => new JsonEncoder(),
561-
]
554+
[
555+
new PropertyNormalizer(),
556+
new ObjectNormalizer(),
557+
new ArrayDenormalizer(),
558+
],
559+
[
560+
'json' => new JsonEncoder(),
561+
]
562562
);
563563

564564
$data = [];

0 commit comments

Comments
 (0)