function BuilderFactory::args
Normalizes an argument list.
Creates Arg nodes for all arguments and converts literal values to expressions.
Parameters
array $args List of arguments to normalize:
Return value
list<Arg>
5 calls to BuilderFactory::args()
- BuilderFactory::attribute in vendor/
nikic/ php-parser/ lib/ PhpParser/ BuilderFactory.php - Creates an attribute node.
- BuilderFactory::funcCall in vendor/
nikic/ php-parser/ lib/ PhpParser/ BuilderFactory.php - Creates a function call node.
- BuilderFactory::methodCall in vendor/
nikic/ php-parser/ lib/ PhpParser/ BuilderFactory.php - Creates a method call node.
- BuilderFactory::new in vendor/
nikic/ php-parser/ lib/ PhpParser/ BuilderFactory.php - Creates an object creation node.
- BuilderFactory::staticCall in vendor/
nikic/ php-parser/ lib/ PhpParser/ BuilderFactory.php - Creates a static method call node.
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ BuilderFactory.php, line 241
Class
Namespace
PhpParserCode
public function args(array $args) : array {
$normalizedArgs = [];
foreach ($args as $key => $arg) {
if (!$arg instanceof Arg) {
$arg = new Arg(BuilderHelpers::normalizeValue($arg));
}
if (\is_string($key)) {
$arg->name = BuilderHelpers::normalizeIdentifier($key);
}
$normalizedArgs[] = $arg;
}
return $normalizedArgs;
}