vendor/symfony/security-core/Authorization/ExpressionLanguage.php line 35

Open in your IDE?
  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\Security\Core\Authorization;
  11. use Psr\Cache\CacheItemPoolInterface;
  12. use Symfony\Component\ExpressionLanguage\ExpressionLanguage as BaseExpressionLanguage;
  13. if (!class_exists(BaseExpressionLanguage::class)) {
  14.     throw new \LogicException(sprintf('The "%s" class requires the "ExpressionLanguage" component. Try running "composer require symfony/expression-language".'ExpressionLanguage::class));
  15. } else {
  16.     // Help opcache.preload discover always-needed symbols
  17.     class_exists(ExpressionLanguageProvider::class);
  18.     /**
  19.      * Adds some function to the default ExpressionLanguage.
  20.      *
  21.      * @author Fabien Potencier <fabien@symfony.com>
  22.      *
  23.      * @see ExpressionLanguageProvider
  24.      */
  25.     class ExpressionLanguage extends BaseExpressionLanguage
  26.     {
  27.         /**
  28.          * {@inheritdoc}
  29.          */
  30.         public function __construct(CacheItemPoolInterface $cache null, array $providers = [])
  31.         {
  32.             // prepend the default provider to let users override it easily
  33.             array_unshift($providers, new ExpressionLanguageProvider());
  34.             parent::__construct($cache$providers);
  35.         }
  36.     }
  37. }