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
COMMENTpublic function NAME(mixed $value = []): CLASS|static
153
+
{
154
+
if (!\is_array($value)) {
155
+
$this->_usedProperties[\'PROPERTY\'] = true;
156
+
$this->PROPERTY = $value;
157
+
158
+
return $this;
159
+
}
160
+
161
+
if (!$this->PROPERTY instanceof CLASS) {
162
+
$this->_usedProperties[\'PROPERTY\'] = true;
163
+
$this->PROPERTY = new CLASS($value);
164
+
} elseif (0 < \func_num_args()) {
165
+
throw new InvalidConfigurationException(\'The node created by "NAME()" has already been initialized. You cannot pass values the second time you call NAME().\');
166
+
}
167
+
168
+
return $this->PROPERTY;
169
+
}' : '
144
170
COMMENTpublic function NAME(array $value = []): CLASS
145
171
{
146
172
if (null === $this->PROPERTY) {
147
173
$this->_usedProperties[\'PROPERTY\'] = true;
148
174
$this->PROPERTY = new CLASS($value);
149
-
} elseif ([] !== $value) {
175
+
} elseif (0 < \func_num_args()) {
150
176
throw new InvalidConfigurationException(\'The node created by "NAME()" has already been initialized. You cannot pass values the second time you call NAME().\');
151
177
}
152
178
@@ -176,14 +202,19 @@ public function NAME(mixed $valueDEFAULT): static
COMMENTpublic function NAME(string $VAR, array $VALUE = []): CLASS
309
+
$body = $hasNormalizationClosures ? '
310
+
COMMENTpublic function NAME(string $VAR, mixed $VALUE = []): CLASS|static
252
311
{
253
-
if (!isset($this->PROPERTY[$VAR])) {
312
+
if (!\is_array($VALUE)) {
254
313
$this->_usedProperties[\'PROPERTY\'] = true;
314
+
$this->PROPERTY[$VAR] = $VALUE;
255
315
256
-
return $this->PROPERTY[$VAR] = new CLASS($VALUE);
316
+
return $this;
257
317
}
258
-
if ([] === $VALUE) {
259
-
return $this->PROPERTY[$VAR];
318
+
319
+
if (!isset($this->PROPERTY[$VAR]) || !$this->PROPERTY[$VAR] instanceof CLASS) {
320
+
$this->_usedProperties[\'PROPERTY\'] = true;
321
+
$this->PROPERTY[$VAR] = new CLASS($VALUE);
322
+
} elseif (1 < \func_num_args()) {
323
+
throw new InvalidConfigurationException(\'The node created by "NAME()" has already been initialized. You cannot pass values the second time you call NAME().\');
260
324
}
261
325
262
-
throw new InvalidConfigurationException(\'The node created by "NAME()" has already been initialized. You cannot pass values the second time you call NAME().\');
326
+
return $this->PROPERTY[$VAR];
327
+
}' : '
328
+
COMMENTpublic function NAME(string $VAR, array $VALUE = []): CLASS
329
+
{
330
+
if (!isset($this->PROPERTY[$VAR])) {
331
+
$this->_usedProperties[\'PROPERTY\'] = true;
332
+
$this->PROPERTY[$VAR] = new CLASS($VALUE);
333
+
} elseif (1 < \func_num_args()) {
334
+
throw new InvalidConfigurationException(\'The node created by "NAME()" has already been initialized. You cannot pass values the second time you call NAME().\');
0 commit comments