FlexibleDocStringEmulator
extends TokenEmulator
Table of Contents
-
FLEXIBLE_DOC_STRING_REGEX
= <<<'REGEX'
/<<<[ ]*(['"]?)([a-zA-Z_�-�][a-zA-Z0-9_�-�]*)
?
(?:.*
?
)*?
(?<indentation>h*)(?![a-zA-Z0-9_�-�])(?<separator>(?:;?[
])?)/x
REGEX
-
emulate()
: array<string|int, mixed>
-
getPhpVersion()
: string
-
isEmulationNeeded()
: bool
-
preprocessCode()
: string
-
reverseEmulate()
: array<string|int, mixed>
FLEXIBLE_DOC_STRING_REGEX
public
mixed
FLEXIBLE_DOC_STRING_REGEX
= <<<'REGEX'
/<<<[ ]*(['"]?)([a-zA-Z_�-�][a-zA-Z0-9_�-�]*)
?
(?:.*
?
)*?
(?<indentation>h*)(?![a-zA-Z0-9_�-�])(?<separator>(?:;?[
])?)/x
REGEX
emulate()
public
emulate(string $code, array<string|int, mixed> $tokens) : array<string|int, mixed>
Parameters
-
$code
: string
-
-
$tokens
: array<string|int, mixed>
-
Return values
array<string|int, mixed>
—
getPhpVersion()
public
getPhpVersion() : string
Return values
string
—
isEmulationNeeded()
public
isEmulationNeeded(string $code) : bool
Parameters
-
$code
: string
-
Return values
bool
—
preprocessCode()
public
preprocessCode(string $code, array<string|int, mixed> &$patches) : string
Parameters
-
$code
: string
-
-
$patches
: array<string|int, mixed>
-
Return values
string
—
reverseEmulate()
public
reverseEmulate(string $code, array<string|int, mixed> $tokens) : array<string|int, mixed>
Parameters
-
$code
: string
-
-
$tokens
: array<string|int, mixed>
-
Return values
array<string|int, mixed>
—