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
__construct()
public
__construct() : mixed
canProcess()
public
canProcess(mixed $placeholder) : bool
Parameters
- $placeholder : mixed
Return values
boolprocess()
public
process(string $value) : string
Parameters
- $value : string
Return values
stringcontainsPlaceholder()
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
boolgetParts()
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
stringprocessSinglePlaceholder()
protected
processSinglePlaceholder(string $placeholder, string $value) : mixed
Parameters
- $placeholder : string
- $value : string