1: <?php declare(strict_types=1);
2:
3: namespace PhpParser\Node;
4:
5: use PhpParser\Node\VariadicPlaceholder;
6: use PhpParser\NodeAbstract;
7:
8: class Arg extends NodeAbstract
9: {
10: /** @var Identifier|null Parameter name (for named parameters) */
11: public $name;
12: /** @var Expr Value to pass */
13: public $value;
14: /** @var bool Whether to pass by ref */
15: public $byRef;
16: /** @var bool Whether to unpack the argument */
17: public $unpack;
18:
19: /**
20: * Constructs a function call argument node.
21: *
22: * @param Expr $value Value to pass
23: * @param bool $byRef Whether to pass by ref
24: * @param bool $unpack Whether to unpack the argument
25: * @param array $attributes Additional attributes
26: * @param Identifier|null $name Parameter name (for named parameters)
27: */
28: public function __construct(
29: Expr $value, bool $byRef = false, bool $unpack = false, array $attributes = [],
30: ?Identifier $name = null
31: ) {
32: $this->attributes = $attributes;
33: $this->name = $name;
34: $this->value = $value;
35: $this->byRef = $byRef;
36: $this->unpack = $unpack;
37: }
38:
39: public function getSubNodeNames() : array {
40: return ['name', 'value', 'byRef', 'unpack'];
41: }
42:
43: public function getType() : string {
44: return 'Arg';
45: }
46: }
47: