PHP Class M1\Vars\Variables\VariableProvider

Since: 0.1.0
Datei anzeigen Open project: m1/Vars Class Usage Examples

Public Properties

Property Type Description
$rstore ReplacementStore The replacement store
$vstore VariableStore The variable store

Public Methods

Method Description
__construct ( Vars $vars ) Creates new instance of VariableProvider
doReplacements ( string $value, array $matches, string $type ) : string Does the replacements in the string for the variable
parse ( string $value ) : string Parses the string for the types of variables

Private Methods

Method Description
checkVariableExists ( string $variable, string $type ) : boolean Checks to see if the variable exists
fetchVariable ( string $variable_name, string $type ) : string Fetches the variable from the stores
fetchVariableMatches ( string $value, string $regex ) : array Fetches the variable matches in the string
typeParse ( string $value, string $type ) : string Parses the string based on the type of variable

Method Details

__construct() public method

Creates new instance of VariableProvider
public __construct ( Vars $vars )
$vars M1\Vars\Vars Instance of the calling Vars

doReplacements() public method

Does the replacements in the string for the variable
public doReplacements ( string $value, array $matches, string $type ) : string
$value string The string to parse
$matches array The matches
$type string The variable type
return string The parsed variable

parse() public method

Parses the string for the types of variables
public parse ( string $value ) : string
$value string The string to parse
return string The parsed variable

Property Details

$rstore public_oe property

The replacement store
public ReplacementStore,M1\Vars\Variables $rstore
return ReplacementStore

$vstore public_oe property

The variable store
public VariableStore,M1\Vars\Variables $vstore
return VariableStore