Files
apimacro/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php

45 lines
1.3 KiB
PHP
Raw Normal View History

2024-05-07 12:17:25 +02:00
<?php declare(strict_types=1);
namespace PhpParser\Node;
use PhpParser\NodeAbstract;
2024-05-17 12:24:19 +00:00
class Arg extends NodeAbstract {
2024-05-07 12:17:25 +02:00
/** @var Identifier|null Parameter name (for named parameters) */
2024-05-17 12:24:19 +00:00
public ?Identifier $name;
2024-05-07 12:17:25 +02:00
/** @var Expr Value to pass */
2024-05-17 12:24:19 +00:00
public Expr $value;
2024-05-07 12:17:25 +02:00
/** @var bool Whether to pass by ref */
2024-05-17 12:24:19 +00:00
public bool $byRef;
2024-05-07 12:17:25 +02:00
/** @var bool Whether to unpack the argument */
2024-05-17 12:24:19 +00:00
public bool $unpack;
2024-05-07 12:17:25 +02:00
/**
* Constructs a function call argument node.
*
2024-05-17 12:24:19 +00:00
* @param Expr $value Value to pass
* @param bool $byRef Whether to pass by ref
* @param bool $unpack Whether to unpack the argument
* @param array<string, mixed> $attributes Additional attributes
2024-05-07 12:17:25 +02:00
* @param Identifier|null $name Parameter name (for named parameters)
*/
public function __construct(
Expr $value, bool $byRef = false, bool $unpack = false, array $attributes = [],
2024-05-17 12:24:19 +00:00
?Identifier $name = null
2024-05-07 12:17:25 +02:00
) {
$this->attributes = $attributes;
$this->name = $name;
$this->value = $value;
$this->byRef = $byRef;
$this->unpack = $unpack;
}
2024-05-17 12:24:19 +00:00
public function getSubNodeNames(): array {
2024-05-07 12:17:25 +02:00
return ['name', 'value', 'byRef', 'unpack'];
}
2024-05-17 12:24:19 +00:00
public function getType(): string {
2024-05-07 12:17:25 +02:00
return 'Arg';
}
}