EnvPlaceholderProcessor

Can process a string consisting of one or multiple %env(...)% YAML placeholders, and replace them with their evaluated values.

This in contrast to the EnvVariableProcessor, which only evaluates a single ENV value (without the placeholders), and is also utilized for the actual expansion here by means of the PlaceholderProcessorList.

Table of Contents

Constants

PATTERN_PARTS  = '%[^(%]+?\([\'"]?([^(]*?)[\'"]?\)%|%([^%()]*?)%'

Properties

$processorList  : array<string|int, mixed>

Methods

__construct()  : mixed
canProcess()  : bool
process()  : string
containsPlaceholder()  : bool
Finds possible placeholders.
getParts()  : array<string|int, mixed>
processPlaceholderLine()  : string
The following methods are taken from YamlFileLoader, but adapted for isolated usage and preventing circular dependencies.
processSinglePlaceholder()  : mixed

Constants

PATTERN_PARTS

public mixed PATTERN_PARTS = '%[^(%]+?\([\'"]?([^(]*?)[\'"]?\)%|%([^%()]*?)%'

Properties

$processorList

protected array<string|int, mixed> $processorList = []

Methods

canProcess()

public canProcess(mixed $placeholder) : bool
Parameters
$placeholder : mixed
Return values
bool

process()

public process(string $value) : string
Parameters
$value : string
Return values
string

containsPlaceholder()

Finds possible placeholders.

protected containsPlaceholder(mixed $value) : bool

May find false positives for complexer structures, but they will be sorted later on.

Parameters
$value : mixed
Return values
bool

getParts()

protected getParts(string $placeholders) : array<string|int, mixed>
Parameters
$placeholders : string
Return values
array<string|int, mixed>

processPlaceholderLine()

The following methods are taken from YamlFileLoader, but adapted for isolated usage and preventing circular dependencies.

protected processPlaceholderLine(string $line) : string
Parameters
$line : string
Return values
string

processSinglePlaceholder()

protected processSinglePlaceholder(string $placeholder, string $value) : mixed
Parameters
$placeholder : string
$value : string

        
On this page

Search results