Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ResolveEnvPlaceholdersPass.php

class ResolveEnvPlaceholdersPass

Replaces env var placeholders by their current values.

Hierarchy

  • class \Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass implements \Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface
    • class \Symfony\Component\DependencyInjection\Compiler\ResolveEnvPlaceholdersPass extends \Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass

Expanded class hierarchy of ResolveEnvPlaceholdersPass

1 file declares its use of ResolveEnvPlaceholdersPass
ContainerBuilder.php in vendor/symfony/dependency-injection/ContainerBuilder.php

File

vendor/symfony/dependency-injection/Compiler/ResolveEnvPlaceholdersPass.php, line 19

Namespace

Symfony\Component\DependencyInjection\Compiler
View source
class ResolveEnvPlaceholdersPass extends AbstractRecursivePass {
    protected bool $skipScalars = false;
    protected function processValue(mixed $value, bool $isRoot = false) : mixed {
        if (\is_string($value)) {
            return $this->container
                ->resolveEnvPlaceholders($value, true);
        }
        if ($value instanceof Definition) {
            $changes = $value->getChanges();
            if (isset($changes['class'])) {
                $value->setClass($this->container
                    ->resolveEnvPlaceholders($value->getClass(), true));
            }
            if (isset($changes['file'])) {
                $value->setFile($this->container
                    ->resolveEnvPlaceholders($value->getFile(), true));
            }
        }
        $value = parent::processValue($value, $isRoot);
        if ($value && \is_array($value) && !$isRoot) {
            $value = array_combine($this->container
                ->resolveEnvPlaceholders(array_keys($value), true), $value);
        }
        return $value;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
AbstractRecursivePass::$container protected property
AbstractRecursivePass::$currentId protected property
AbstractRecursivePass::$expressionLanguage private property 1
AbstractRecursivePass::$inExpression private property
AbstractRecursivePass::$processExpressions private property
AbstractRecursivePass::enableExpressionProcessing protected function
AbstractRecursivePass::getConstructor protected function
AbstractRecursivePass::getExpressionLanguage private function 1
AbstractRecursivePass::getReflectionMethod protected function
AbstractRecursivePass::inExpression protected function
AbstractRecursivePass::process public function Overrides CompilerPassInterface::process 15
ResolveEnvPlaceholdersPass::$skipScalars protected property Overrides AbstractRecursivePass::$skipScalars
ResolveEnvPlaceholdersPass::processValue protected function Processes a value found in a definition tree. Overrides AbstractRecursivePass::processValue
RSS feed
Powered by Drupal