Documentation

PhpParser
in package

Parses a file for namespaces/use/class declarations.

Tags
author

Fabien Potencier fabien@symfony.com

author

Christian Kaps christian.kaps@mohiva.com

Table of Contents

parseClass()  : array<string|int, mixed>
Parses a class.
getFileContent()  : string|null
Gets the content of the file right up to the given line number.

Methods

parseClass()

Parses a class.

public parseClass(ReflectionClass $class) : array<string|int, mixed>
Parameters
$class : ReflectionClass

A ReflectionClass object.

Return values
array<string|int, mixed>

A list with use statements in the form (Alias => FQN).

getFileContent()

Gets the content of the file right up to the given line number.

private getFileContent(string $filename, int $lineNumber) : string|null
Parameters
$filename : string

The name of the file to load.

$lineNumber : int

The number of lines to read from file.

Return values
string|null

The content of the file or null if the file does not exist.

Search results