FlexibleDocStringEmulator
extends TokenEmulator
in package
FinalYes
Table of Contents
Constants
- FLEXIBLE_DOC_STRING_REGEX = <<<'REGEX' /<<<[ \t]*(['"]?)([a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*)\1\r?\n (?:.*\r?\n)*? (?<indentation>\h*)\2(?![a-zA-Z0-9_\x80-\xff])(?<separator>(?:;?[\r\n])?)/x REGEX
Methods
- emulate() : array<string|int, mixed>
- getPhpVersion() : string
- isEmulationNeeded() : bool
- preprocessCode() : string
- reverseEmulate() : array<string|int, mixed>
Constants
FLEXIBLE_DOC_STRING_REGEX
public
mixed
FLEXIBLE_DOC_STRING_REGEX
= <<<'REGEX'
/<<<[ \t]*(['"]?)([a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*)\1\r?\n
(?:.*\r?\n)*?
(?<indentation>\h*)\2(?![a-zA-Z0-9_\x80-\xff])(?<separator>(?:;?[\r\n])?)/x
REGEX
Methods
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
stringisEmulationNeeded()
public
isEmulationNeeded(string $code) : bool
Parameters
- $code : string
Return values
boolpreprocessCode()
public
preprocessCode(string $code, array<string|int, mixed> &$patches) : string
Parameters
- $code : string
- $patches : array<string|int, mixed>
Return values
stringreverseEmulate()
public
reverseEmulate(string $code, array<string|int, mixed> $tokens) : array<string|int, mixed>
Parameters
- $code : string
- $tokens : array<string|int, mixed>