org.zenmagick.core.utils.packer\ZMPhpSourceAnalyzer
core\utils\packer\ZMPhpSourceAnalyzer.php at line 30
Class ZMPhpSourceAnalyzer
ZMPhpSourceAnalyzer
public class ZMPhpSourceAnalyzer
- Author:
- DerManoMann
| Method Summary |
| static array |
buildDepdencyTree(array files, array resolvedDeps) Build a dependency tree for a list of PHP sources.
|
| static array |
getDependencies(string source) Get source info.
|
Method Detail
core\utils\packer\ZMPhpSourceAnalyzer.php at line 175
buildDepdencyTree
public static array buildDepdencyTree(array files, array resolvedDeps)
Build a dependency tree for a list of PHP sources.
In fact, this isn't really a tree, but a simple array with files in the next value
depending on files in the previous ones.
- Parameters:
- files - List of files.
- resolvedDeps - Optional list of class/interface names to be treated as resolved.
- Returns:
- A dependency tree.
core\utils\packer\ZMPhpSourceAnalyzer.php at line 93
getDependencies
public static array getDependencies(string source)
Get source info.
Analyzes the given PHP source and extracts the following information:
- Included classes and interfaces
- Classes and interfaces this PHP source code depends on.
There are a few assumptions about PHP sources that affect how these results may be used:
- A source is assumed to be valid. That means it will load without errors.
- The above implies that dependencies within a single source are resolved by having classes/interfaces
in the right order in the source.
- Parameters:
- source - The file source.
- Returns:
- Two element map with the keys contains and . Each value is also a two element map with the keys classes and interfaces. Values are arrays containing class and interface names.
Analyze dependencies of a given (PHP) source.