4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\DependencyInjection\Compiler
;
14 use Symfony\Component\DependencyInjection\Definition
;
15 use Symfony\Component\DependencyInjection\Alias
;
18 * Represents a node in your service graph.
20 * Value is typically a definition, or an alias.
22 * @author Johannes M. Schmitt <schmittjoh@gmail.com>
24 class ServiceReferenceGraphNode
27 private $inEdges = array();
28 private $outEdges = array();
32 * @param string $id The node identifier
33 * @param mixed $value The node value
35 public function __construct($id, $value)
38 $this->value
= $value;
41 public function addInEdge(ServiceReferenceGraphEdge
$edge)
43 $this->inEdges
[] = $edge;
46 public function addOutEdge(ServiceReferenceGraphEdge
$edge)
48 $this->outEdges
[] = $edge;
52 * Checks if the value of this node is an Alias.
54 * @return bool True if the value is an Alias instance
56 public function isAlias()
58 return $this->value
instanceof Alias
;
62 * Checks if the value of this node is a Definition.
64 * @return bool True if the value is a Definition instance
66 public function isDefinition()
68 return $this->value
instanceof Definition
;
72 * Returns the identifier.
76 public function getId()
82 * Returns the in edges.
84 * @return array The in ServiceReferenceGraphEdge array
86 public function getInEdges()
88 return $this->inEdges
;
92 * Returns the out edges.
94 * @return array The out ServiceReferenceGraphEdge array
96 public function getOutEdges()
98 return $this->outEdges
;
102 * Returns the value of this Node.
104 * @return mixed The value
106 public function getValue()