Skip to content

Commit 1353694

Browse files
ro0NLnicolas-grekas
authored andcommitted
[Config] Introduce BuilderAwareInterface
1 parent d203ee3 commit 1353694

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Config\Definition\Builder;
13+
14+
/**
15+
* An interface that can be implemented by nodes which build other nodes.
16+
*
17+
* @author Roland Franssen <franssen.roland@gmail.com>
18+
*/
19+
interface BuilderAwareInterface
20+
{
21+
public function setBuilder(NodeBuilder $builder);
22+
}

src/Symfony/Component/Config/Definition/Builder/NodeBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public function node($name, $type)
186186
*/
187187
public function append(NodeDefinition $node)
188188
{
189-
if ($node instanceof ParentNodeDefinitionInterface) {
189+
if ($node instanceof BuilderAwareInterface) {
190190
$builder = clone $this;
191191
$builder->setParent(null);
192192
$node->setBuilder($builder);

src/Symfony/Component/Config/Definition/Builder/ParentNodeDefinitionInterface.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@
1616
*
1717
* @author Victor Berchet <victor@suumit.com>
1818
*/
19-
interface ParentNodeDefinitionInterface
19+
interface ParentNodeDefinitionInterface extends BuilderAwareInterface
2020
{
2121
public function children();
2222

2323
public function append(NodeDefinition $node);
24-
25-
public function setBuilder(NodeBuilder $builder);
2624
}

0 commit comments

Comments
 (0)