Skip to content

Commit e1b891c

Browse files
committed
Fixing fabbot's CS returns
1 parent 8c5d806 commit e1b891c

File tree

4 files changed

+12
-21
lines changed

4 files changed

+12
-21
lines changed

src/Symfony/Component/Serializer/Exception/MissingConstructorArgumentsException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ class MissingConstructorArgumentsException extends RuntimeException
2727
private $class = null;
2828

2929
/**
30-
* @param string[] $missingArguments
30+
* @param string[] $missingArguments
3131
* @param class-string|null $class
3232
*/
33-
public function __construct(string $message, int $code = 0, \Throwable $previous = null, array $missingArguments = [], ?string $class = null)
33+
public function __construct(string $message, int $code = 0, \Throwable $previous = null, array $missingArguments = [], string $class = null)
3434
{
3535
$this->missingConstructorArguments = $missingArguments;
3636
$this->class = $class;

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

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -404,17 +404,7 @@ protected function instantiateObject(array &$data, string $class, array &$contex
404404
}
405405

406406
if (!empty($missingConstructorArguments)) {
407-
throw new MissingConstructorArgumentsException(
408-
sprintf(
409-
'Cannot create an instance of "%s" from serialized data because its constructor requires the following parameters to be present : "%s".',
410-
$class,
411-
implode('", "', $missingConstructorArguments)
412-
),
413-
0,
414-
null,
415-
$missingConstructorArguments,
416-
$class,
417-
);
407+
throw new MissingConstructorArgumentsException(sprintf('Cannot create an instance of "%s" from serialized data because its constructor requires the following parameters to be present : "%s".', $class, implode('", "', $missingConstructorArguments)), 0, null, $missingConstructorArguments, $class);
418408
}
419409

420410
if ($constructor->isConstructor()) {

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,6 @@ public function __construct(
137137
$this->objectClassResolver = ($objectClassResolver ?? 'get_class')(...);
138138
}
139139

140-
/**
141-
* @param array $context
142-
*/
143140
public function supportsNormalization(mixed $data, string $format = null /* , array $context = [] */)
144141
{
145142
return \is_object($data) && !$data instanceof \Traversable;
@@ -292,14 +289,9 @@ abstract protected function extractAttributes(object $object, string $format = n
292289

293290
/**
294291
* Gets the attribute value.
295-
*
296-
* @return mixed
297292
*/
298293
abstract protected function getAttributeValue(object $object, string $attribute, string $format = null, array $context = []);
299294

300-
/**
301-
* @param array $context
302-
*/
303295
public function supportsDenormalization(mixed $data, string $type, string $format = null /* , array $context = [] */)
304296
{
305297
return class_exists($type) || (interface_exists($type, false) && null !== $this->classDiscriminatorResolver?->getMappingForClass($type));

src/Symfony/Component/Serializer/Tests/Exception/MissingConstructorArgumentsExceptionTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Exception;
413

514
use PHPUnit\Framework\TestCase;

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