ZenMagick 0.9.10


org.zenmagick.core.utils.packer\ZMPhpSourceAnalyzer
core\utils\packer\ZMPhpSourceAnalyzer.php at line 30

Class ZMPhpSourceAnalyzer

ZMPhpSourceAnalyzer

public class ZMPhpSourceAnalyzer

Analyze dependencies of a given (PHP) source.

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:

There are a few assumptions about PHP sources that affect how these results may be used:

  1. A source is assumed to be valid. That means it will load without errors.
  2. 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.

ZenMagick 0.9.10