ServiceReferenceGraphEdge.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. * @param ServiceReferenceGraphNode $sourceNode
  25. * @param ServiceReferenceGraphNode $destNode
  26. * @param mixed $value
  27. */
  28. public function __construct(ServiceReferenceGraphNode $sourceNode, ServiceReferenceGraphNode $destNode, $value = null)
  29. {
  30. $this->sourceNode = $sourceNode;
  31. $this->destNode = $destNode;
  32. $this->value = $value;
  33. }
  34. /**
  35. * Returns the value of the edge.
  36. *
  37. * @return string
  38. */
  39. public function getValue()
  40. {
  41. return $this->value;
  42. }
  43. /**
  44. * Returns the source node.
  45. *
  46. * @return ServiceReferenceGraphNode
  47. */
  48. public function getSourceNode()
  49. {
  50. return $this->sourceNode;
  51. }
  52. /**
  53. * Returns the destination node.
  54. *
  55. * @return ServiceReferenceGraphNode
  56. */
  57. public function getDestNode()
  58. {
  59. return $this->destNode;
  60. }
  61. }