Files
apimacro/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php

38 lines
1.0 KiB
PHP
Raw Normal View History

2024-05-07 12:17:25 +02:00
<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
use PhpParser\Node;
2024-05-17 12:24:19 +00:00
class TryCatch extends Node\Stmt {
2024-05-07 12:17:25 +02:00
/** @var Node\Stmt[] Statements */
2024-05-17 12:24:19 +00:00
public array $stmts;
2024-05-07 12:17:25 +02:00
/** @var Catch_[] Catches */
2024-05-17 12:24:19 +00:00
public array $catches;
2024-05-07 12:17:25 +02:00
/** @var null|Finally_ Optional finally node */
2024-05-17 12:24:19 +00:00
public ?Finally_ $finally;
2024-05-07 12:17:25 +02:00
/**
* Constructs a try catch node.
*
2024-05-17 12:24:19 +00:00
* @param Node\Stmt[] $stmts Statements
* @param Catch_[] $catches Catches
* @param null|Finally_ $finally Optional finally node
* @param array<string, mixed> $attributes Additional attributes
2024-05-07 12:17:25 +02:00
*/
2024-05-17 12:24:19 +00:00
public function __construct(array $stmts, array $catches, ?Finally_ $finally = null, array $attributes = []) {
2024-05-07 12:17:25 +02:00
$this->attributes = $attributes;
$this->stmts = $stmts;
$this->catches = $catches;
$this->finally = $finally;
}
2024-05-17 12:24:19 +00:00
public function getSubNodeNames(): array {
2024-05-07 12:17:25 +02:00
return ['stmts', 'catches', 'finally'];
}
2024-05-17 12:24:19 +00:00
public function getType(): string {
2024-05-07 12:17:25 +02:00
return 'Stmt_TryCatch';
}
}