Skip to content

Commit 9154e59

Browse files
committed
code style fixes
1 parent 0f6b02c commit 9154e59

File tree

8 files changed

+8
-34
lines changed

8 files changed

+8
-34
lines changed

Controller/TemplatingExceptionController.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,7 @@ public function __construct(
2929
$templating
3030
) {
3131
if (!$templating instanceof EngineInterface && !$templating instanceof Environment) {
32-
throw new \TypeError(sprintf(
33-
'The fourth argument of %s must be an instance of %s or %s, but %s was given.',
34-
__METHOD__,
35-
EngineInterface::class,
36-
Environment::class,
37-
is_object($templating) ? get_class($templating) : gettype($templating)
38-
));
32+
throw new \TypeError(sprintf('The fourth argument of %s must be an instance of %s or %s, but %s was given.', __METHOD__, EngineInterface::class, Environment::class, is_object($templating) ? get_class($templating) : gettype($templating)));
3933
}
4034

4135
parent::__construct($viewHandler, $exceptionCodes, $showException);

Decoder/ContainerDecoderProvider.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ public function supports($format)
5454
public function getDecoder($format)
5555
{
5656
if (!$this->supports($format)) {
57-
throw new \InvalidArgumentException(
58-
sprintf("Format '%s' is not supported by ContainerDecoderProvider.", $format)
59-
);
57+
throw new \InvalidArgumentException(sprintf("Format '%s' is not supported by ContainerDecoderProvider.", $format));
6058
}
6159

6260
return $this->container->get($this->decoders[$format]);

DependencyInjection/Configuration.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,9 +441,7 @@ private function addExceptionSection(ArrayNodeDefinition $rootNode)
441441
}
442442

443443
if (!defined('Symfony\Component\HttpFoundation\Response::'.$item)) {
444-
throw new InvalidConfigurationException(
445-
'Invalid HTTP code in fos_rest.exception.codes, see Symfony\Component\HttpFoundation\Response for all valid codes.'
446-
);
444+
throw new InvalidConfigurationException('Invalid HTTP code in fos_rest.exception.codes, see Symfony\Component\HttpFoundation\Response for all valid codes.');
447445
}
448446

449447
$item = constant('Symfony\Component\HttpFoundation\Response::'.$item);

Form/Transformer/EntityToIdObjectTransformer.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,7 @@ public function reverseTransform($idObject)
8181
->findOneBy([$identifier => $id]);
8282

8383
if (null === $object) {
84-
throw new TransformationFailedException(sprintf(
85-
'An object with identifier key "%s" and value "%s" does not exist!',
86-
$identifier, $id
87-
));
84+
throw new TransformationFailedException(sprintf('An object with identifier key "%s" and value "%s" does not exist!', $identifier, $id));
8885
}
8986

9087
return $object;

Normalizer/CamelKeysNormalizer.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ private function normalizeArray(array &$data)
4646

4747
if ($normalizedKey !== $key) {
4848
if (array_key_exists($normalizedKey, $normalizedData)) {
49-
throw new NormalizationException(sprintf(
50-
'The key "%s" is invalid as it will override the existing key "%s"',
51-
$key,
52-
$normalizedKey
53-
));
49+
throw new NormalizationException(sprintf('The key "%s" is invalid as it will override the existing key "%s"', $key, $normalizedKey));
5450
}
5551
}
5652

Request/ParamFetcher.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,7 @@ protected function cleanParamWithRequirements(ParamInterface $param, $paramValue
134134
}
135135

136136
if (null === $this->validator) {
137-
throw new \RuntimeException(
138-
'The ParamFetcher requirements feature requires the symfony/validator component.'
139-
);
137+
throw new \RuntimeException('The ParamFetcher requirements feature requires the symfony/validator component.');
140138
}
141139

142140
$constraints = $param->getConstraints();

Request/ParameterBag.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ private function initParams($requestId)
7474
{
7575
$controller = $this->params[$requestId]['controller'];
7676
if (!is_array($controller) || empty($controller[0]) || !is_object($controller[0])) {
77-
throw new \InvalidArgumentException(
78-
'Controller needs to be set as a class instance (closures/functions are not supported)'
79-
);
77+
throw new \InvalidArgumentException('Controller needs to be set as a class instance (closures/functions are not supported)');
8078
}
8179

8280
$class = class_exists(ClassUtils::class)

Util/ResolverTrait.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,7 @@ private function resolveValue(ContainerInterface $container, $value)
5151
return (string) $resolved;
5252
}
5353

54-
throw new \RuntimeException(sprintf(
55-
'The container parameter "%s" must be a string or numeric, but it is of type %s.',
56-
$match[1],
57-
gettype($resolved)
58-
)
59-
);
54+
throw new \RuntimeException(sprintf('The container parameter "%s" must be a string or numeric, but it is of type %s.', $match[1], gettype($resolved)));
6055
}, $value);
6156

6257
return str_replace('%%', '%', $escapedValue);

0 commit comments

Comments
 (0)