Error.php 757 B

123456789101112131415161718192021222324252627282930
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node\Expr;
  3. use PhpParser\Node\Expr;
  4. /**
  5. * Error node used during parsing with error recovery.
  6. *
  7. * An error node may be placed at a position where an expression is required, but an error occurred.
  8. * Error nodes will not be present if the parser is run in throwOnError mode (the default).
  9. */
  10. class Error extends Expr {
  11. /**
  12. * Constructs an error node.
  13. *
  14. * @param array<string, mixed> $attributes Additional attributes
  15. */
  16. public function __construct(array $attributes = []) {
  17. $this->attributes = $attributes;
  18. }
  19. public function getSubNodeNames(): array {
  20. return [];
  21. }
  22. public function getType(): string {
  23. return 'Expr_Error';
  24. }
  25. }