\PhpParserParserFactory

Summary

Methods
Properties
Constants
create()
No public properties found
PREFER_PHP7
PREFER_PHP5
ONLY_PHP7
ONLY_PHP5
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

PREFER_PHP7

PREFER_PHP7 = 1

PREFER_PHP5

PREFER_PHP5 = 2

ONLY_PHP7

ONLY_PHP7 = 3

ONLY_PHP5

ONLY_PHP5 = 4

Methods

create()

create(integer  $kind, \PhpParser\Lexer|null  $lexer = null, array  $parserOptions = array()) : \PhpParser\Parser

Creates a Parser instance, according to the provided kind.

Parameters

integer $kind

One of ::PREFER_PHP7, ::PREFER_PHP5, ::ONLY_PHP7 or ::ONLY_PHP5

\PhpParser\Lexer|null $lexer

Lexer to use. Defaults to emulative lexer when not specified

array $parserOptions

Parser options. See ParserAbstract::__construct() argument

Returns

\PhpParser\Parser

The parser instance