Expression.php 726 B

1234567891011121314151617181920212223242526272829303132
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node\Stmt;
  3. use PhpParser\Node;
  4. /**
  5. * Represents statements of type "expr;"
  6. */
  7. class Expression extends Node\Stmt {
  8. /** @var Node\Expr Expression */
  9. public Node\Expr $expr;
  10. /**
  11. * Constructs an expression statement.
  12. *
  13. * @param Node\Expr $expr Expression
  14. * @param array<string, mixed> $attributes Additional attributes
  15. */
  16. public function __construct(Node\Expr $expr, array $attributes = []) {
  17. $this->attributes = $attributes;
  18. $this->expr = $expr;
  19. }
  20. public function getSubNodeNames(): array {
  21. return ['expr'];
  22. }
  23. public function getType(): string {
  24. return 'Stmt_Expression';
  25. }
  26. }