BladeMatterParser
in package
Tags
Table of Contents
Constants
- SEARCH = '@php($'
Properties
Methods
- __construct() : mixed
- get() : array<string|int, mixed>
- parse() : static
- parseFile() : array<string|int, mixed>
- parseString() : array<string|int, mixed>
- extractKey() : string
- extractValue() : string
- getValueWithType() : scalar|array<string, scalar>
- isValueArrayString() : bool
- lineMatchesFrontMatter() : bool
- parseArrayString() : array<string, scalar>
Constants
SEARCH
protected
string
SEARCH
= '@php($'
The directive signature used to determine if a line should be parsed.
Properties
$contents
protected
string
$contents
$matter
protected
array<string|int, mixed>
$matter
Methods
__construct()
public
__construct(string $contents) : mixed
Parameters
- $contents : string
get()
public
get() : array<string|int, mixed>
Return values
array<string|int, mixed>parse()
public
parse() : static
Return values
staticparseFile()
public
static parseFile(string $path) : array<string|int, mixed>
Parameters
- $path : string
Return values
array<string|int, mixed>parseString()
public
static parseString(string $contents) : array<string|int, mixed>
Parameters
- $contents : string
Return values
array<string|int, mixed>extractKey()
protected
static extractKey(string $line) : string
Parameters
- $line : string
Return values
stringextractValue()
protected
static extractValue(string $line) : string
Parameters
- $line : string
Return values
stringgetValueWithType()
protected
static getValueWithType(string $value) : scalar|array<string, scalar>
Parameters
- $value : string
Return values
scalar|array<string, scalar>isValueArrayString()
protected
static isValueArrayString(string $string) : bool
Parameters
- $string : string
Return values
boollineMatchesFrontMatter()
protected
static lineMatchesFrontMatter(string $line) : bool
Parameters
- $line : string
Return values
boolparseArrayString()
protected
static parseArrayString(string $string) : array<string, scalar>
Parameters
- $string : string