ServiceReferenceGraphEdge.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\DependencyInjection\Compiler;
  11. /**
  12. * Represents an edge in your service graph.
  13. *
  14. * Value is typically a reference.
  15. *
  16. * @author Johannes M. Schmitt <schmittjoh@gmail.com>
  17. */
  18. class ServiceReferenceGraphEdge
  19. {
  20. private $sourceNode;
  21. private $destNode;
  22. private $value;
  23. /**
  24. * Constructor.
  25. *
  26. * @param ServiceReferenceGraphNode $sourceNode
  27. * @param ServiceReferenceGraphNode $destNode
  28. * @param string $value
  29. */
  30. public function __construct(ServiceReferenceGraphNode $sourceNode, ServiceReferenceGraphNode $destNode, $value = null)
  31. {
  32. $this->sourceNode = $sourceNode;
  33. $this->destNode = $destNode;
  34. $this->value = $value;
  35. }
  36. /**
  37. * Returns the value of the edge
  38. *
  39. * @return ServiceReferenceGraphNode
  40. */
  41. public function getValue()
  42. {
  43. return $this->value;
  44. }
  45. /**
  46. * Returns the source node
  47. *
  48. * @return ServiceReferenceGraphNode
  49. */
  50. public function getSourceNode()
  51. {
  52. return $this->sourceNode;
  53. }
  54. /**
  55. * Returns the destination node
  56. *
  57. * @return ServiceReferenceGraphNode
  58. */
  59. public function getDestNode()
  60. {
  61. return $this->destNode;
  62. }
  63. }