[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/vendor/symfony/dependency-injection/ -> Reference.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;
  13  
  14  /**
  15   * Reference represents a service reference.
  16   *
  17   * @author Fabien Potencier <fabien@symfony.com>
  18   */
  19  class Reference
  20  {
  21      private $id;
  22      private $invalidBehavior;
  23      private $strict;
  24  
  25      /**
  26       * Note: The $strict parameter is deprecated since version 2.8 and will be removed in 3.0.
  27       *
  28       * @param string $id              The service identifier
  29       * @param int    $invalidBehavior The behavior when the service does not exist
  30       * @param bool   $strict          Sets how this reference is validated
  31       *
  32       * @see Container
  33       */
  34      public function __construct($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, $strict = true)
  35      {
  36          $this->id = strtolower($id);
  37          $this->invalidBehavior = $invalidBehavior;
  38          $this->strict = $strict;
  39      }
  40  
  41      /**
  42       * @return string The service identifier
  43       */
  44      public function __toString()
  45      {
  46          return $this->id;
  47      }
  48  
  49      /**
  50       * Returns the behavior to be used when the service does not exist.
  51       *
  52       * @return int
  53       */
  54      public function getInvalidBehavior()
  55      {
  56          return $this->invalidBehavior;
  57      }
  58  
  59      /**
  60       * Returns true when this Reference is strict.
  61       *
  62       * @return bool
  63       *
  64       * @deprecated since version 2.8, to be removed in 3.0.
  65       */
  66      public function isStrict($triggerDeprecationError = true)
  67      {
  68          if ($triggerDeprecationError) {
  69              @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
  70          }
  71  
  72          return $this->strict;
  73      }
  74  }


Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1