-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stmt\Block will be created for { $a; } style blocks, unless these occur directly inside some structure that is usually combined with a block. For example if ($a) { $b; } will continue to use the old representation (plain array in in If_::$stmts), but a free-standing { $b; } will become a Stmt\Block. Fixes #590.
- Loading branch information
Showing
19 changed files
with
1,700 additions
and
1,641 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace PhpParser\Node\Stmt; | ||
|
||
use PhpParser\Node\Stmt; | ||
|
||
class Block extends Stmt { | ||
/** @var Stmt[] Statements */ | ||
public array $stmts; | ||
|
||
/** | ||
* A block of statements. | ||
* | ||
* @param Stmt[] $stmts Statements | ||
* @param array<string, mixed> $attributes Additional attributes | ||
*/ | ||
public function __construct(array $stmts, array $attributes = []) { | ||
$this->attributes = $attributes; | ||
$this->stmts = $stmts; | ||
} | ||
|
||
public function getType(): string { | ||
return 'Stmt_Block'; | ||
} | ||
|
||
public function getSubNodeNames(): array { | ||
return ['stmts']; | ||
} | ||
} |
Oops, something went wrong.