StringFragmentSplitter

Splits a string into RAW and EXPRESSION fragments.

EXPRESSION fragments are resolved by provided arbitrary regex pattern.

Internal

Table of Contents

Constants

FLAG_UNMATCHED_AS_NULL  = 1
Returns `null` in case there have not been any pattern matches, if omitted an array containing only `raw` fragments is returned
TYPE_EXPRESSION  = 'expression'
Literals used as expression
TYPE_RAW  = 'raw'
Raw string literals

Properties

$patterns  : array<int, StringFragmentPattern>

Methods

__construct()  : mixed
split()  : StringFragmentCollection|null
preparePatterns()  : array<int, string>

Constants

FLAG_UNMATCHED_AS_NULL

Returns `null` in case there have not been any pattern matches, if omitted an array containing only `raw` fragments is returned

public mixed FLAG_UNMATCHED_AS_NULL = 1

TYPE_EXPRESSION

Literals used as expression

public mixed TYPE_EXPRESSION = 'expression'

TYPE_RAW

Raw string literals

public mixed TYPE_RAW = 'raw'

Properties

Methods

preparePatterns()

protected preparePatterns() : array<int, string>
Return values
array<int, string>

        
On this page

Search results