2015-08-17 17:00:26 -07:00
< ? php
/*
* This file is part of the Symfony package .
*
* ( c ) Fabien Potencier < fabien @ symfony . com >
*
* For the full copyright and license information , please view the LICENSE
* file that was distributed with this source code .
*/
namespace Symfony\Component\DependencyInjection\Compiler ;
/**
* Represents an edge in your service graph .
*
* Value is typically a reference .
*
* @ author Johannes M . Schmitt < schmittjoh @ gmail . com >
*/
class ServiceReferenceGraphEdge
{
private $sourceNode ;
private $destNode ;
private $value ;
2018-11-23 12:29:20 +00:00
private $lazy ;
private $weak ;
2015-08-17 17:00:26 -07:00
/**
* @ param ServiceReferenceGraphNode $sourceNode
* @ param ServiceReferenceGraphNode $destNode
2018-11-23 12:29:20 +00:00
* @ param mixed $value
* @ param bool $lazy
* @ param bool $weak
2015-08-17 17:00:26 -07:00
*/
2018-11-23 12:29:20 +00:00
public function __construct ( ServiceReferenceGraphNode $sourceNode , ServiceReferenceGraphNode $destNode , $value = null , $lazy = false , $weak = false )
2015-08-17 17:00:26 -07:00
{
$this -> sourceNode = $sourceNode ;
$this -> destNode = $destNode ;
$this -> value = $value ;
2018-11-23 12:29:20 +00:00
$this -> lazy = $lazy ;
$this -> weak = $weak ;
2015-08-17 17:00:26 -07:00
}
/**
* Returns the value of the edge .
*
2017-02-02 16:28:38 -08:00
* @ return string
2015-08-17 17:00:26 -07:00
*/
public function getValue ()
{
return $this -> value ;
}
/**
* Returns the source node .
*
* @ return ServiceReferenceGraphNode
*/
public function getSourceNode ()
{
return $this -> sourceNode ;
}
/**
* Returns the destination node .
*
* @ return ServiceReferenceGraphNode
*/
public function getDestNode ()
{
return $this -> destNode ;
}
2018-11-23 12:29:20 +00:00
/**
* Returns true if the edge is lazy , meaning it ' s a dependency not requiring direct instantiation .
*
* @ return bool
*/
public function isLazy ()
{
return $this -> lazy ;
}
/**
* Returns true if the edge is weak , meaning it shouldn ' t prevent removing the target service .
*
* @ return bool
*/
public function isWeak ()
{
return $this -> weak ;
}
2015-08-17 17:00:26 -07:00
}