Copied!
CloneableInstantiable
Methods
public __construct(?PhpParser\PhpVersion $phpVersion = NULL)
 
  • param \PhpVersion|null $phpVersion PHP version to emulate. Defaults to newest supported.
public tokenize(string $code, ?PhpParser\ErrorHandler $errorHandler = NULL) : array
Methods
protected PhpParser\Lexer::postprocessTokens(array $tokens, PhpParser\ErrorHandler $errorHandler) : void
 
  • param list<\Token> $tokens
Properties
private array $emulators = []
 
  • var list<\TokenEmulator>
private PhpParser\PhpVersion $hostPhpVersion
private array $patches = []
 
  • var array{: int, : string, : string}[] Patches used to reverse changes introduced in the code
private PhpParser\PhpVersion $targetPhpVersion
Methods
private fixupErrors(array $errors) : void
 

Fixup line and position information in errors.

  • param \Error[] $errors
private fixupTokens(array $tokens) : array
 
  • param list<\Token> $tokens
  • return list<\Token>
private isForwardEmulationNeeded(PhpParser\PhpVersion $emulatorPhpVersion) : bool
private isReverseEmulationNeeded(PhpParser\PhpVersion $emulatorPhpVersion) : bool
private sortPatches() : void
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration