function Utils::getPropertiesMap
Returns the properties map for the given node
Parameters
mixed $node Node or class to consider:
Return value
array
1 call to Utils::getPropertiesMap()
- Utils::getNodeProperties in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Utils.php - Returns the properties list for the given node
File
-
vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Utils.php, line 231
Class
- Utils
- Utilities class.
Namespace
Peast\SyntaxCode
protected static function getPropertiesMap($node) {
static $cache = array();
if ($node instanceof \ReflectionClass) {
$className = $node->getName();
}
else {
$className = get_class($node);
}
if (!isset($cache[$className])) {
$class = new \ReflectionClass($className);
$parent = $class->getParentClass();
$props = $parent ? self::getPropertiesMap($parent) : array();
$defaults = $class->getDefaultProperties();
if (isset($defaults["propertiesMap"])) {
$props = array_merge($props, $defaults["propertiesMap"]);
}
$cache[$className] = $props;
}
return $cache[$className];
}