composer package updates
[openemr.git] / vendor / symfony / dependency-injection / Compiler / ServiceReferenceGraphNode.php
blob3219d06e969897d54b99b41d4d7b4f5273b9b69d
1 <?php
3 /*
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;
17 /**
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
26 private $id;
27 private $inEdges = array();
28 private $outEdges = array();
29 private $value;
31 /**
32 * @param string $id The node identifier
33 * @param mixed $value The node value
35 public function __construct($id, $value)
37 $this->id = $id;
38 $this->value = $value;
41 public function addInEdge(ServiceReferenceGraphEdge $edge)
43 $this->inEdges[] = $edge;
46 public function addOutEdge(ServiceReferenceGraphEdge $edge)
48 $this->outEdges[] = $edge;
51 /**
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;
61 /**
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;
71 /**
72 * Returns the identifier.
74 * @return string
76 public function getId()
78 return $this->id;
81 /**
82 * Returns the in edges.
84 * @return array The in ServiceReferenceGraphEdge array
86 public function getInEdges()
88 return $this->inEdges;
91 /**
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()
108 return $this->value;