Class: Autoload
Source Location: /PHP_CodeSniffer-3.0.0RC2/autoload.php
Autoloads files for PHP_CodeSniffer and tracks what has been loaded.
Author(s):
Copyright:
- 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600)
Inherited Variables
Inherited Methods
Class Details
[line
19]
Autoloads files for PHP_CodeSniffer and tracks what has been loaded.
Due to different namespaces being used for custom coding standards, the autoloader keeps track of what class is loaded after a file is included, even if the file is ultimately included by another autoloader (such as composer).
This allows PHP_CodeSniffer to request the class name after loading a class when it only knows the filename, without having to parse the file to find it.
Method Detail
getLoadedClasses [line 164]
Gets the mapping of file names to class names.
- Return: string>
- Access: public
getLoadedClassName [line 129]
string getLoadedClassName(
string
$path)
Gets the class name for the given file path.
- Throws: \Exception If the file path has not been loaded.
- Access: public
Parameters:
string
$path
—
The name of the file.
getLoadedFileName [line 148]
string getLoadedFileName(
string
$class)
Gets the file path for the given class name.
- Throws: \Exception If the class name has not been loaded
- Access: public
Parameters:
string
$class
—
The name of the class.
getLoadedFiles [line 176]
Gets the mapping of class names to file names.
- Return: string>
- Access: public
load [line 47]
bool load(
string
$class)
Loads a class.
This method only loads classes that exist in the PHP_CodeSniffer namespace. All other classes are ignored and loaded by subsequent autoloaders.
Parameters:
string
$class
—
The name of the class to load.
loadFile [line 84]
string loadFile(
string
$path)
Includes a file and tracks what class or interface was loaded as a result.
- Return: The fully qualified name of the class in the loaded file.
- Access: public
Parameters:
string
$path
—
The path of the file to load.
Documentation generated on 2019年3月11日 14:49:28 -0400 by
phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.