Expression.php 717 B

123456789101112131415161718192021222324252627282930313233
  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. {
  9. /** @var Node\Expr Expression */
  10. public $expr;
  11. /**
  12. * Constructs an expression statement.
  13. *
  14. * @param Node\Expr $expr Expression
  15. * @param array $attributes Additional attributes
  16. */
  17. public function __construct(Node\Expr $expr, array $attributes = []) {
  18. $this->attributes = $attributes;
  19. $this->expr = $expr;
  20. }
  21. public function getSubNodeNames() : array {
  22. return ['expr'];
  23. }
  24. public function getType() : string {
  25. return 'Stmt_Expression';
  26. }
  27. }