Class to find class type tokens

category Development
package mpAutoloaderClassMap
author Murat Purc

 Methods

Initializes class with passed options

__construct(array $options) 

Parameters

$options

array

Assoziative options array as follows: - excludeDirs: (array) List of directories to exclude, optional. Default values are '.svn' and '.cvs'. - excludeFiles: (array) List of files to exclude, optional. Default values are '/^~..php$/' and '/^~..inc$/'. - extensionsToParse: (array) List of file extensions to parse, optional. Default values are '.php' and '.inc'. - enableDebug: (bool) Flag to enable debugging, optional. Default value is false.

Detects all available class type tokens in found files inside passed directory.

findInDir(SplFileInfo $fileInfo, bool $recursive) : array | null

Parameters

$fileInfo

\SplFileInfo

$recursive

bool

Flag to parse directory recursive

Returns

arraynullEither a assoziative array where the key is the class type token and the value is the path or null.

Detects all available class type tokens in passed file

findInFile(SplFileInfo $fileInfo) : array | null

Parameters

$fileInfo

\SplFileInfo

Returns

arraynullEither a assoziative array where the key is the class type token and the value is the path or null.

Returns list of debug messages

getDebugMessages() : array

Returns

array

Returns list of directories to exclude

getExcludeDirs() : array

Returns

array

Returns list of files to exclude

getExcludeFiles() : array

Returns

array

Returns list of file extension to parse

getExtensionsToParse() : array

Returns

array

Returns debug messages in a formatted way.

getFormattedDebugMessages(string $delemiter, string $wrap) : string

Parameters

$delemiter

string

Delemiter between each message

$wrap

string

String with %s type specifier used to wrap all messages

Returns

stringFormatted string

Sets directories to exclude

setExcludeDirs(array $excludeDirs) : void

Parameters

$excludeDirs

array

Sets files to exclude

setExcludeFiles(array $excludeFiles) : void

Parameters

$excludeFiles

array

Feasible values are - temp.php (single file name) - ~.php (with * wildcard) Will be replaced against regex '/^~..php$/'

Sets file extensions to parse

setExtensionsToParse(array $extensionsToParse) : void

Parameters

$extensionsToParse

array

Adds passed message to debug list, if debugging is enabled

_debug(string $msg) : void

Parameters

$msg

string

Returns directory iterator depending on $recursive parameter value

_getDirIterator(SplFileInfo $fileInfo, bool $recursive) : \RecursiveIteratorIterator | \DirectoryIterator

Parameters

$fileInfo

$recursive

bool

Returns

Checks if directory is to exclude

_isDirToExclude(SplFileInfo $file) : bool

Parameters

$file

\SplFileInfo

Returns

bool

Checks if file is to exclude

_isFileToExclude(SplFileInfo $file) : bool

Parameters

$file

\SplFileInfo

Returns

bool

Checks if file is to parse (if file extension matches)

_isFileToParse(SplFileInfo $file) : bool

Parameters

$file

\SplFileInfo

Returns

bool

Checks if file is to proccess

_isFileToProccess(SplFileInfo $file) : bool

Parameters

$file

\SplFileInfo

Returns

bool

Replaces windows style directory separator (backslash against slash)

_normalizePathSeparator($path) : string

Parameters

$path

string

Returns

string

 Properties

 

List of debugging messages, will e filled, if debugging is active

$_debugMessages : array

 

Flag to enable debugging, all messages will be collected in property _debugMessages, if enabled

$_enableDebug : bool

 

List of directories to ignore (note: is case insensitive)

$_excludeDirs : array

 

List of files to ignore, regex pattern is also accepted (note: is case insensitive)

$_excludeFiles : array

 

List of file extensions to parse (note: is case insensitive)

$_extensionsToParse : array