-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ede722f
commit a34f6df
Showing
9 changed files
with
229 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
ReflectionClass | ||
============== | ||
|
||
The `ReflectionClass` class reports an information about a class. This class is available in the standard PHP, so for any questions, please look at documentation for [`ReflectionClass`][0] | ||
|
||
But be careful, that several methods require the class to be loaded into the memory, otherwise an exception will be thrown. | ||
|
||
List of methods, that require class to be loaded | ||
--------- | ||
|
||
- ReflectionClass::newInstance — Creates a new class instance from given arguments. | ||
- ReflectionClass::newInstanceArgs — Creates a new class instance from given arguments. | ||
- ReflectionClass::newInstanceWithoutConstructor — Creates a new class instance without invoking the constructor. | ||
- ReflectionClass::setStaticPropertyValue — Sets static property value | ||
|
||
[0]: http://php.net/manual/en/class.reflectionclass.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
ReflectionFile | ||
============== | ||
|
||
The `ReflectionFile` class reports an information about a file with valid PHP source code. This class is not available in the standard PHP | ||
|
||
API | ||
--- | ||
|
||
```php | ||
class ReflectionFile | ||
{ | ||
public function __construct($fileName, $topLevelNodes = null) {} | ||
public function getFileNamespace($namespaceName) {} | ||
public function getFileNamespaces() {} | ||
public function getName() {} | ||
public function hasFileNamespace($namespaceName) {} | ||
} | ||
``` | ||
|
||
Methods | ||
------- | ||
|
||
- `ReflectionFile::__construct($fileName, $topLevelNodes = null)` | ||
|
||
Constructs an instance of `ReflectionFile` object for given `fileName`. Can accept custom AST-tree nodes as optional parameter. | ||
|
||
- `ReflectionFile::getFileNamespace($namespaceName)` | ||
|
||
Returns a [`ReflectionFileNamespace`][0] instance for the specified namespace in a file. If you don't know an exact name of namespace in the file, then use `getFileNamespaces()` method to get a full list of namespaces for inspection. | ||
|
||
- `ReflectionFile::getFileNamespaces()` | ||
|
||
Returns an array with available namespaces in the file. Each `namespace {}` section will be represented as a single instance of [`ReflectionFileNamespace`][0] in this list. | ||
|
||
- `ReflectionFile::getName()` | ||
|
||
Returns a string with the name of file | ||
|
||
- `ReflectionFile::hasFileNamespace($namespaceName)` | ||
|
||
Checks if requested namespace is present in the file or not. Returns `true` if present. | ||
|
||
|
||
[0]: reflection_file_namespace.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
ReflectionFileNamespace | ||
============== | ||
|
||
The `ReflectionFileNamespace` class reports an information about a namespace in the single file. This class is not available in the standard PHP | ||
|
||
API | ||
--- | ||
|
||
```php | ||
class ReflectionFileNamespace | ||
{ | ||
public function __construct($fileName, $namespaceName, Namespace_ $namespaceNode = null) {} | ||
public function getClass($className) {} | ||
public function getClasses() {} | ||
public function getConstant($constantName) {} | ||
public function getConstants() {} | ||
public function getDocComment() {} | ||
public function getEndLine() {} | ||
public function getFileName() {} | ||
public function getFunction($functionName) {} | ||
public function getFunctions() {} | ||
public function getName() {} | ||
public function getNamespaceAliases() {} | ||
public function getStartLine() {} | ||
public function hasClass($className) {} | ||
public function hasConstant($constantName) {} | ||
public function hasFunction($functionName) {} | ||
} | ||
``` | ||
|
||
Methods | ||
------- | ||
|
||
- `ReflectionFileNamespace::__construct($fileName, $namespaceName, Namespace_ $namespaceNode = null)` | ||
|
||
Constructs an instance of `ReflectionFileNamespace` object for given `fileName` and `namespaceName`. Can accept custom `Namespace_` node as optional parameter. | ||
|
||
- `ReflectionFileNamespace::getClass($className)` | ||
|
||
Returns the concrete [`ReflectionClass`][0] from the file namespace or `false` if there is no such a class in the current namespace | ||
|
||
- `ReflectionFileNamespace::getClasses()` | ||
|
||
Returns an array with available classes in the namespace. Each class/trait/interface definition will be represented as a single instance of [`ReflectionClass`][0] in this list. | ||
|
||
- `ReflectionFileNamespace::getConstant($constantName)` | ||
|
||
Returns a value for the constant with name `$constantName` in the file namespace or `false` if there is no such a constant in the current namespace. | ||
|
||
- `ReflectionFileNamespace::getConstants()` | ||
|
||
Returns an array with all available constants in the namespace. | ||
|
||
- `ReflectionFileNamespace::getDocComment()` | ||
|
||
Returns a doc-block section for file namespace if present, otherwise `false` | ||
|
||
- `ReflectionFileNamespace::getEndLine()` | ||
|
||
Returns a end line for the namespace. Be careful, this value is not correct for simple `namespace Name;` definitions. | ||
|
||
- `ReflectionFileNamespace::getFileName()` | ||
|
||
Returns a string with the name of file | ||
|
||
- `ReflectionFileNamespace::getFunction($functionName)` | ||
|
||
Returns the concrete [`ReflectionFunction`][1] from the file namespace or `false` if there is no such a function in the current namespace | ||
|
||
- `ReflectionFileNamespace::getFunctions()` | ||
|
||
Returns an array with available functions in the namespace. Each function definition will be represented as a single instance of [`ReflectionFunction`][1] in this list. | ||
|
||
- `ReflectionFile::getName()` | ||
|
||
Returns a string with the name of current file namespace | ||
|
||
- `ReflectionFileNamespace::getNamespaceAliases()` | ||
|
||
Returns an array with all imported class namespaces and aliases for them in the current namespace. | ||
|
||
- `ReflectionFileNamespace::getStartLine()` | ||
|
||
Returns a start line for the namespace. | ||
|
||
- `ReflectionFileNamespace::hasClass($className)` | ||
|
||
Checks if the requested class is present in the file namespace or not. Returns `true` if present. | ||
|
||
- `ReflectionFileNamespace::hasConstant($constantName)` | ||
|
||
Checks if the requested constant is present in the file namespace or not. Returns `true` if present. | ||
|
||
- `ReflectionFileNamespace::hasFunction($functionName)` | ||
|
||
Checks if the requested function is present in the file namespace or not. Returns `true` if present. | ||
|
||
[0]: reflection_class.md | ||
[1]: reflection_function.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
ReflectionFunction | ||
============== | ||
|
||
The `ReflectionFunction` class reports an information about a function. This class is available in the standard PHP, so for any questions, please look at documentation for [`ReflectionFunction`][0] | ||
|
||
But be careful, that several methods require the function to be loaded into the memory, otherwise an exception will be thrown. | ||
|
||
List of methods, that require function to be loaded | ||
--------- | ||
|
||
- ReflectionFunction::getClosure — Returns a dynamically created closure for the function | ||
- ReflectionFunction::invoke — Invokes function | ||
- ReflectionFunction::invokeArgs — Invokes function args | ||
|
||
[0]: http://php.net/manual/en/class.reflectionfunction.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
ReflectionMethod | ||
============== | ||
|
||
The `ReflectionMethod` class reports an information about a method. This class is available in the standard PHP, so for any questions, please look at documentation for [`ReflectionMethod`][0] | ||
|
||
But be careful, that several methods require the method and class to be loaded into the memory, otherwise an exception will be thrown. | ||
|
||
List of methods, that require method and a corresponding class to be loaded | ||
--------- | ||
|
||
- ReflectionMethod::getClosure — Returns a dynamically created closure for the method | ||
- ReflectionMethod::invoke — Invokes method | ||
- ReflectionMethod::invokeArgs — Invokes method args | ||
- ReflectionMethod::setAccessible — Set method accessibility | ||
|
||
[0]: http://php.net/manual/en/class.reflectionmethod.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ReflectionParameter | ||
============== | ||
|
||
The `ReflectionParameter` class reports an information about an parameter. This class is available in the standard PHP, so for any questions, please look at documentation for [`ReflectionParameter`][0] | ||
|
||
[0]: http://php.net/manual/en/class.reflectionparameter.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
ReflectionProperty | ||
============== | ||
|
||
The `ReflectionProperty` class reports an information about a property. This class is available in the standard PHP, so for any questions, please look at documentation for [`ReflectionProperty`][0] | ||
|
||
But be careful, that several methods require the property and class to be loaded into the memory, otherwise an exception will be thrown. | ||
|
||
List of methods, that require property and a corresponding class to be loaded | ||
--------- | ||
|
||
- ReflectionProperty::setAccessible — Set property accessibility | ||
- ReflectionProperty::setValue — Set property value | ||
|
||
|
||
[0]: http://php.net/manual/en/class.reflectionproperty.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ReflectionType | ||
============== | ||
|
||
The `ReflectionType` class reports an information about a type. This class is available in the standard PHP, so for any questions, please look at documentation for [`ReflectionType`][0] | ||
|
||
[0]: http://php.net/manual/en/class.reflectiontype.php |