Arg.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node;
  3. use PhpParser\NodeAbstract;
  4. class Arg extends NodeAbstract
  5. {
  6. /** @var Expr Value to pass */
  7. public $value;
  8. /** @var bool Whether to pass by ref */
  9. public $byRef;
  10. /** @var bool Whether to unpack the argument */
  11. public $unpack;
  12. /**
  13. * Constructs a function call argument node.
  14. *
  15. * @param Expr $value Value to pass
  16. * @param bool $byRef Whether to pass by ref
  17. * @param bool $unpack Whether to unpack the argument
  18. * @param array $attributes Additional attributes
  19. */
  20. public function __construct(Expr $value, bool $byRef = false, bool $unpack = false, array $attributes = []) {
  21. parent::__construct($attributes);
  22. $this->value = $value;
  23. $this->byRef = $byRef;
  24. $this->unpack = $unpack;
  25. }
  26. public function getSubNodeNames() : array {
  27. return ['value', 'byRef', 'unpack'];
  28. }
  29. public function getType() : string {
  30. return 'Arg';
  31. }
  32. }