class PhpParser

internal  
 

Parses PHP source code and returns:

  • the start/end line information about functions, classes, interfaces, traits and their methods
  • the count of code lines
  • the count of commented code lines

Methods

parse($code)

No description

Details

at line 50
stdClass parse($code)

No description

Parameters

$code

Return Value

stdClass

Returned structure is: stdClass { linesOfCode: int, linesOfComments: int, functions: [functionName => $functionInfo], classes: [className => $info], traits: [traitName => $info], interfaces: [interfaceName => $info], }

where $functionInfo is: stdClass { start: int, end: int }

and $info is: stdClass { start: int, end: int, methods: [methodName => $methodInfo] }

where $methodInfo is: stdClass { start: int, end: int, visibility: public|protected|private }