You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
throw new InvalidConfigurationException(\'The node created by "NAME()" has already been initialized. You cannot pass values the second time you call NAME().\');
162
+
}
163
+
164
+
return $this->PROPERTY;
165
+
}' : '
141
166
public function NAME(array $value = []): CLASS
142
167
{
143
168
if (null === $this->PROPERTY) {
144
169
$this->_usedProperties[\'PROPERTY\'] = true;
145
170
$this->PROPERTY = new CLASS($value);
146
-
} elseif ([] !== $value) {
171
+
} elseif (0 < \func_num_args()) {
147
172
throw new InvalidConfigurationException(\'The node created by "NAME()" has already been initialized. You cannot pass values the second time you call NAME().\');
148
173
}
149
174
@@ -227,10 +252,29 @@ public function NAME(string $VAR, $VALUE): self
public function NAME(string $VAR, array $VALUE = []): CLASS
286
+
$body = $hasNormalizationClosures ? '
287
+
/**
288
+
* @return CLASS|$this
289
+
*/
290
+
public function NAME(string $VAR, $VALUE = [])
244
291
{
245
-
if (!isset($this->PROPERTY[$VAR])) {
292
+
if (!\is_array($VALUE)) {
246
293
$this->_usedProperties[\'PROPERTY\'] = true;
294
+
$this->PROPERTY[$VAR] = $VALUE;
247
295
248
-
return $this->PROPERTY[$VAR] = new CLASS($VALUE);
296
+
return $this;
249
297
}
250
-
if ([] === $VALUE) {
251
-
return $this->PROPERTY[$VAR];
298
+
299
+
if (!isset($this->PROPERTY[$VAR]) || !$this->PROPERTY[$VAR] instanceof CLASS) {
300
+
$this->_usedProperties[\'PROPERTY\'] = true;
301
+
$this->PROPERTY[$VAR] = new CLASS($VALUE);
302
+
} elseif (1 < \func_num_args()) {
303
+
throw new InvalidConfigurationException(\'The node created by "NAME()" has already been initialized. You cannot pass values the second time you call NAME().\');
304
+
}
305
+
306
+
return $this->PROPERTY[$VAR];
307
+
}' : '
308
+
public function NAME(string $VAR, array $VALUE = []): CLASS
309
+
{
310
+
if (!isset($this->PROPERTY[$VAR])) {
311
+
$this->_usedProperties[\'PROPERTY\'] = true;
312
+
$this->PROPERTY[$VAR] = new CLASS($VALUE);
313
+
} elseif (1 < \func_num_args()) {
314
+
throw new InvalidConfigurationException(\'The node created by "NAME()" has already been initialized. You cannot pass values the second time you call NAME().\');
252
315
}
253
316
254
-
throw new InvalidConfigurationException(\'The node created by "NAME()" has already been initialized. You cannot pass values the second time you call NAME().\');
Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList/Symfony/Config/AddToList/Messenger/ReceivingConfig.php
0 commit comments