8000 remove else · symfony/symfony@5ba0573 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5ba0573

Browse files
committed
remove else
1 parent 4bb36e3 commit 5ba0573

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

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

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ private function handleVariableNode(VariableNode $node, ClassBuilder $class)
133133

134134
$body = '
135135
/**
136-
COMMENT */
136+
COMMENT * @return $this
137+
*/
137138
public function NAME($valueDEFAULT): self
138139
{
139140
$this->PROPERTY = $value;
@@ -154,6 +155,9 @@ private function handlePrototypedArrayNode(PrototypedArrayNode $node, ClassBuild
154155
$property = $class->addProperty($node->getName());
155156
if (null === $key = $node->getKeyAttribute()) {
156157
$body = '
158+
/**
159+
* @return $this
160+
*/
157161
public function NAME(TYPE$value): self
158162
{
159163
$this->PROPERTY = $value;
@@ -163,6 +167,9 @@ public function NAME(TYPE$value): self
163167
$class->addMethod($methodName, $body, ['PROPERTY' => $property->getName(), 'TYPE' => '' === $parameterType ? '' : $parameterType.' ']);
164168
} else {
165169
$body = '
170+
/**
171+
* @return $this
172+
*/
166173
public function NAME(string $VAR, TYPE$VALUE): self
167174
{
168175
$this->PROPERTY[$VAR] = $VALUE;
@@ -194,11 +201,12 @@ public function NAME(string $VAR, array $VALUE = []): CLASS
194201
{
195202
if (!isset($this->PROPERTY[$VAR])) {
196203
return $this->PROPERTY[$VAR] = new CLASS($value);
197-
} elseif ([] === $value) {
204+
}
205+
if ([] === $value) {
198206
return $this->PROPERTY[$VAR];
199-
} else {
200-
throw new \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException(sprintf(\'The node created by "NAME()" has already been initialized. You cannot pass values the second time you call NAME().\'));
201207
}
208+
209+
throw new \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException(sprintf(\'The node created by "NAME()" has already been initialized. You cannot pass values the second time you call NAME().\'));
202210
}';
203211
$class->addMethod($methodName, $body, ['PROPERTY' => $property->getName(), 'CLASS' => $childClass->getFqcn(), 'VAR' => '' === $key ? 'key' : $key, 'VALUE' => 'value' === $key ? 'data' : 'value']);
204212
}
@@ -213,7 +221,8 @@ private function handleScalarNode(ScalarNode $node, ClassBuilder $class)
213221

214222
$body = '
215223
/**
216-
COMMENT */
224+
COMMENT * @return $this
225+
*/
217226
public function NAME(TYPE$value): self
218227
{
219228
$this->PROPERTY = $value;

src/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,6 @@ private function executeCallback(callable $callback, ContainerConfigurator $cont
108108
$arguments[] = $containerConfigurator;
109109
break;
110110
case ContainerBuilder::class:
111-
case Container::class:
112-
case ContainerInterface::class:
113-
case \Psr\Container\ContainerInterface::class:
114111
$arguments[] = $this->container;
115112
break;
116113
case FileLoader::class:

0 commit comments

Comments
 (0)
0