Skip to content

Commit 8e801df

Browse files
committed
[Serializer] Apply code standards
Fabbot.io came up with these code standard fixes.
1 parent 6c64b0c commit 8e801df

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

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

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,6 @@ public function __construct(ClassMetadataFactoryInterface $classMetadataFactory
150150
}
151151
}
152152

153-
/**
154-
* {@inheritdoc}
155-
*/
156153
public function hasCacheableSupportsMethod(): bool
157154
{
158155
return false;
@@ -193,8 +190,6 @@ protected function isCircularReference(object $object, array &$context)
193190
*
194191
* @final
195192
*
196-
* @return mixed
197-
*
198193
* @throws CircularReferenceException
199194
*/
200195
protected function handleCircularReference(object $object, string $format = null, array $context = [])
@@ -239,9 +234,9 @@ protected function getAllowedAttributes($classOrObject, array $context, bool $at
239234

240235
// If you update this check, update accordingly the one in Symfony\Component\PropertyInfo\Extractor\SerializerExtractor::getProperties()
241236
if (
242-
!$ignore &&
243-
([] === $groups || array_intersect(array_merge($attributeMetadata->getGroups(), ['*']), $groups)) &&
244-
$this->isAllowedAttribute($classOrObject, $name = $attributeMetadata->getName(), null, $context)
237+
!$ignore
238+
&& ([] === $groups || array_intersect(array_merge($attributeMetadata->getGroups(), ['*']), $groups))
239+
&& $this->isAllowedAttribute($classOrObject, $name = $attributeMetadata->getName(), null, $context)
245240
) {
246241
$allowedAttributes[] = $attributesAsString ? $name : $attributeMetadata;
247242
}
@@ -459,12 +454,7 @@ protected function instantiateObject(array &$data, string $class, array &$contex
459454
unset($context['has_constructor']);
460455

461456
if (!$reflectionClass->isInstantiable()) {
462-
throw NotNormalizableValueException::createForUnexpectedDataType(
463-
sprintf('Failed to create object because the class "%s" is not instantiable.', $class),
464-
$data,
465-
['unknown'],
466-
$context['deserialization_path'] ?? null
467-
);
457+
throw NotNormalizableValueException::createForUnexpectedDataType(sprintf('Failed to create object because the class "%s" is not instantiable.', $class), $data, ['unknown'], $context['deserialization_path'] ?? null);
468458
}
469459

470460
return new $class();
@@ -540,10 +530,7 @@ final protected function validateCallbackContext(array $context, string $context
540530
/**
541531
* Apply callbacks set in context.
542532
*
543-
* @param mixed $value
544533
* @param object|string $object Can be either the object being normalizing or the object's class being denormalized
545-
*
546-
* @return mixed
547534
*/
548535
final protected function applyCallbacks($value, $object, string $attribute, ?string $format, array $context)
549536
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy