Skip to content

Commit e034269

Browse files
Add BC layer for updated constructor types
1 parent 5e208c2 commit e034269

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Definition/BaseNode.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ abstract class BaseNode implements NodeInterface
4747
*/
4848
public function __construct(?string $name, NodeInterface $parent = null, string $pathSeparator = self::DEFAULT_PATH_SEPARATOR)
4949
{
50-
if (null === $name) {
51-
$name = '';
52-
}
53-
if (false !== strpos($name, $pathSeparator)) {
50+
if (false !== strpos($name = (string) $name, $pathSeparator)) {
5451
throw new \InvalidArgumentException('The name must not contain "'.$pathSeparator.'".');
5552
}
5653

Definition/Builder/NodeDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ abstract class NodeDefinition implements NodeParentInterface
4141
public function __construct(?string $name, NodeParentInterface $parent = null)
4242
{
4343
$this->parent = $parent;
44-
$this->name = $name ?? '';
44+
$this->name = $name;
4545
}
4646

4747
/**

0 commit comments

Comments
 (0)