Skip to content

Commit 5f3ae0c

Browse files
Use getPath() instead of custom render function
1 parent 3106382 commit 5f3ae0c

File tree

3 files changed

+2
-15
lines changed

3 files changed

+2
-15
lines changed

Partial/Exception/ChildIsNotAnArrayNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public function __construct(BaseNode $parentNode, $nodeName)
1212
sprintf(
1313
'Child node "%s" is not an array node (current path: "%s")',
1414
$nodeName,
15-
self::renderTravelledPath($parentNode)
15+
$parentNode->getPath()
1616
)
1717
);
1818
}

Partial/Exception/InvalidNodeNavigation.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,6 @@
22

33
namespace Matthias\SymfonyConfigTest\Partial\Exception;
44

5-
use Symfony\Component\Config\Definition\BaseNode;
6-
75
abstract class InvalidNodeNavigation extends \LogicException
86
{
9-
protected static function renderTravelledPath(BaseNode $node)
10-
{
11-
if ($node->getParent()) {
12-
$prefix = self::renderTravelledPath($node->getParent());
13-
$prefix .= '.';
14-
} else {
15-
$prefix = '';
16-
}
17-
18-
return $prefix . $node->getName();
19-
}
207
}

Partial/Exception/UndefinedChildNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public function __construct(NodeInterface $parentNode, $childNodeName)
1212
sprintf(
1313
'Undefined child node "%s" (the part of the path that was successful: "%s")',
1414
$childNodeName,
15-
self::renderTravelledPath($parentNode)
15+
$parentNode->getPath()
1616
)
1717
);
1818
}

0 commit comments

Comments
 (0)