Various utility functions

author Michiel Rook
version $Id: c569f96e625ed8f9c6ae5add2b2f4a0a6c3e5a54 $
package phing.tasks.ext.phpunit
since 2.1.0

 Methods

Derives the classname from a filename.

getClassFromFileName(string $filename) : string
Static

Assumes that there is only one class defined in that particular file, and that the naming follows the dot-path (Java) notation scheme.

Parameters

$filename

string

the filename

Returns

stringthe name fo the class

getDefinedClasses()

getDefinedClasses(string $filename, \Path $classpath) : array
Static

Parameters

$filename

string

the filename

$classpath

\Path

optional classpath

Returns

arraylist of classes defined in the file

Returns the package of a class as defined in the docblock of the class using @package

getPackageName(string $classname) : string
Static

Parameters

$classname

string

the name of the class

Returns

stringthe name of the package

Returns the subpackage of a class as defined in the docblock of the class using @subpackage

getSubpackageName(string $classname) : string | null
Static
author Benjamin Schultz

Parameters

$classname

string

the name of the class

Returns

stringnullthe name of the subpackage

 Properties

 

$definedClasses