UseStatementParser
in package
Use-statement parser class
Scrapes use Foo\Bar; / use Foo\Bar as Baz; lines out of raw PHP source text. Native reflection has
no API for "which traits/classes does this file use," so ClassReflection and TraitReflection both
need this; it previously lived as an identical copy of this regex in each of them.
Tags
Table of Contents
Methods
- parse() : array<string|int, mixed>
- Parse `use` statements out of raw PHP source
Methods
parse()
Parse `use` statements out of raw PHP source
public
static parse(string $sourceCode) : array<string|int, mixed>
Parameters
- $sourceCode : string