Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / dependency-injection / Compiler / ServiceReferenceGraphEdge.php
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\DependencyInjection\Compiler;
13
14 /**
15  * Represents an edge in your service graph.
16  *
17  * Value is typically a reference.
18  *
19  * @author Johannes M. Schmitt <schmittjoh@gmail.com>
20  */
21 class ServiceReferenceGraphEdge
22 {
23     private $sourceNode;
24     private $destNode;
25     private $value;
26     private $lazy;
27     private $weak;
28
29     /**
30      * @param ServiceReferenceGraphNode $sourceNode
31      * @param ServiceReferenceGraphNode $destNode
32      * @param mixed                     $value
33      * @param bool                      $lazy
34      * @param bool                      $weak
35      */
36     public function __construct(ServiceReferenceGraphNode $sourceNode, ServiceReferenceGraphNode $destNode, $value = null, $lazy = false, $weak = false)
37     {
38         $this->sourceNode = $sourceNode;
39         $this->destNode = $destNode;
40         $this->value = $value;
41         $this->lazy = $lazy;
42         $this->weak = $weak;
43     }
44
45     /**
46      * Returns the value of the edge.
47      *
48      * @return string
49      */
50     public function getValue()
51     {
52         return $this->value;
53     }
54
55     /**
56      * Returns the source node.
57      *
58      * @return ServiceReferenceGraphNode
59      */
60     public function getSourceNode()
61     {
62         return $this->sourceNode;
63     }
64
65     /**
66      * Returns the destination node.
67      *
68      * @return ServiceReferenceGraphNode
69      */
70     public function getDestNode()
71     {
72         return $this->destNode;
73     }
74
75     /**
76      * Returns true if the edge is lazy, meaning it's a dependency not requiring direct instantiation.
77      *
78      * @return bool
79      */
80     public function isLazy()
81     {
82         return $this->lazy;
83     }
84
85     /**
86      * Returns true if the edge is weak, meaning it shouldn't prevent removing the target service.
87      *
88      * @return bool
89      */
90     public function isWeak()
91     {
92         return $this->weak;
93     }
94 }