function Utils::getNodeProperties
Returns the properties list for the given node
Parameters
Node\Node $node Node to consider:
bool $traversable If true it returns only traversable properties:
Return value
array
3 calls to Utils::getNodeProperties()
- Attribute::check in vendor/
mck89/ peast/ lib/ Peast/ Selector/ Node/ Part/ Attribute.php - Returns true if the selector part matches the given node, false otherwise
- Node::jsonSerialize in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Node/ Node.php - Returns a serializable version of the node
- Utils::getExpandedNodeProperties in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Utils.php - Returns an expanded version of the traversable node properties. The return of the function is an array of node properties values with arrays flattened
File
-
vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Utils.php, line 262
Class
- Utils
- Utilities class.
Namespace
Peast\SyntaxCode
public static function getNodeProperties(Node\Node $node, $traversable = false) {
$props = self::getPropertiesMap($node);
return array_map(function ($prop) {
$ucProp = ucfirst($prop);
return array(
"name" => $prop,
"getter" => "get{$ucProp}",
"setter" => "set{$ucProp}",
);
}, array_keys($traversable ? array_filter($props) : $props));
}