1: <?php declare(strict_types=1);
2:
3: namespace PhpParser\Node;
4:
5: use PhpParser\NodeAbstract;
6:
7: /**
8: * Represents the "?" argument placeholder of the partial function application syntax,
9: * e.g. the "?" in "foo(?)". Like VariadicPlaceholder, it occurs in the argument list
10: * of a call, in place of an ordinary Arg.
11: */
12: class ArgPlaceholder extends NodeAbstract {
13: /** @var Identifier|null Parameter name (for named placeholders) */
14: public ?Identifier $name;
15:
16: /**
17: * Create a "?" argument placeholder (partial function application syntax).
18: *
19: * @param Identifier|null $name Parameter name (for named placeholders)
20: * @param array<string, mixed> $attributes Additional attributes
21: */
22: public function __construct(?Identifier $name = null, array $attributes = []) {
23: $this->attributes = $attributes;
24: $this->name = $name;
25: }
26:
27: public function getSubNodeNames(): array {
28: return ['name'];
29: }
30:
31: public function getType(): string {
32: return 'ArgPlaceholder';
33: }
34: }
35: