Skip to content

Commit 098586c

Browse files
Apply suggestions from code review
Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
1 parent 096a798 commit 098586c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Symfony/Component/Config/Builder/ConfigBuilderGenerator.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private function handleArrayNode(ArrayNode $node, ClassBuilder $class, string $n
132132

133133
$hasNormalizationClosures = $this->hasNormalizationClosures($node);
134134
$comment = $this->getComment($node);
135-
if ($hasNormalizationClosures && $paramType !== 'array') {
135+
if ($hasNormalizationClosures && 'array' !== $paramType) {
136136
$comment = sprintf(" * @template TValue of %s\n * @param TValue \$value\n%s", $paramType, $comment);
137137
$comment .= sprintf(' * @return %s|$this'."\n", $childClass->getFqcn());
138138
$comment .= sprintf(' * @psalm-return (TValue is array ? %s : static)'."\n ", $childClass->getFqcn());
@@ -145,7 +145,7 @@ private function handleArrayNode(ArrayNode $node, ClassBuilder $class, string $n
145145
$node->getName(),
146146
$this->getType($childClass->getFqcn(), $hasNormalizationClosures)
147147
);
148-
$body = $hasNormalizationClosures && $paramType !== 'array' ? '
148+
$body = $hasNormalizationClosures && 'array' !== $paramType ? '
149149
COMMENTpublic function NAME(PARAM_TYPE $value = []): CLASS|static
150150
{
151151
if (!\is_array($value)) {
@@ -286,7 +286,7 @@ public function NAME(string $VAR, TYPE $VALUE): static
286286
$paramType = $this->getParamType($noKey ? $nodeParameterTypes : $prototypeParameterTypes);
287287

288288
$comment = $this->getComment($node);
289-
if ($hasNormalizationClosures && $paramType !== 'array') {
289+
if ($hasNormalizationClosures && 'array' !== $paramType) {
290290
$comment = sprintf(" * @template TValue of %s\n * @param TValue \$value\n%s", $paramType, $comment);
291291
$comment .= sprintf(' * @return %s|$this'."\n", $childClass->getFqcn());
292292
$comment .= sprintf(' * @psalm-return (TValue is array ? %s : static)'."\n ", $childClass->getFqcn());
@@ -296,7 +296,7 @@ public function NAME(string $VAR, TYPE $VALUE): static
296296
}
297297

298298
if ($noKey) {
299-
$body = $hasNormalizationClosures && $paramType !== 'array' ? '
299+
$body = $hasNormalizationClosures && 'array' !== $paramType ? '
300300
COMMENTpublic function NAME(PARAM_TYPE $value = []): CLASS|static
301301
{
302302
$this->_usedProperties[\'PROPERTY\'] = true;
@@ -321,7 +321,7 @@ public function NAME(string $VAR, TYPE $VALUE): static
321321
'PARAM_TYPE' => $paramType,
322322
]);
323323
} else {
324-
$body = $hasNormalizationClosures && $paramType !== 'array' ? '
324+
$body = $hasNormalizationClosures && 'array' !== $paramType ? '
325325
COMMENTpublic function NAME(string $VAR, PARAM_TYPE $VALUE = []): CLASS|static
326326
{
327327
if (!\is_array($VALUE)) {

0 commit comments

Comments
 (0)