[ Index ]

PHP Cross Reference of phpBB-3.3.14-deutsch

title

Body

[close]

/vendor/symfony/dependency-injection/Compiler/ -> ServiceReferenceGraphEdge.php (source)

   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      private $byConstructor;
  29  
  30      /**
  31       * @param mixed $value
  32       * @param bool  $lazy
  33       * @param bool  $weak
  34       * @param bool  $byConstructor
  35       */
  36      public function __construct(ServiceReferenceGraphNode $sourceNode, ServiceReferenceGraphNode $destNode, $value = null, $lazy = false, $weak = false, $byConstructor = false)
  37      {
  38          $this->sourceNode = $sourceNode;
  39          $this->destNode = $destNode;
  40          $this->value = $value;
  41          $this->lazy = $lazy;
  42          $this->weak = $weak;
  43          $this->byConstructor = $byConstructor;
  44      }
  45  
  46      /**
  47       * Returns the value of the edge.
  48       *
  49       * @return string
  50       */
  51      public function getValue()
  52      {
  53          return $this->value;
  54      }
  55  
  56      /**
  57       * Returns the source node.
  58       *
  59       * @return ServiceReferenceGraphNode
  60       */
  61      public function getSourceNode()
  62      {
  63          return $this->sourceNode;
  64      }
  65  
  66      /**
  67       * Returns the destination node.
  68       *
  69       * @return ServiceReferenceGraphNode
  70       */
  71      public function getDestNode()
  72      {
  73          return $this->destNode;
  74      }
  75  
  76      /**
  77       * Returns true if the edge is lazy, meaning it's a dependency not requiring direct instantiation.
  78       *
  79       * @return bool
  80       */
  81      public function isLazy()
  82      {
  83          return $this->lazy;
  84      }
  85  
  86      /**
  87       * Returns true if the edge is weak, meaning it shouldn't prevent removing the target service.
  88       *
  89       * @return bool
  90       */
  91      public function isWeak()
  92      {
  93          return $this->weak;
  94      }
  95  
  96      /**
  97       * Returns true if the edge links with a constructor argument.
  98       *
  99       * @return bool
 100       */
 101      public function isReferencedByConstructor()
 102      {
 103          return $this->byConstructor;
 104      }
 105  }


Generated: Mon Nov 25 19:05:08 2024 Cross-referenced by PHPXref 0.7.1