-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathStatementGenerator.php
More file actions
50 lines (41 loc) · 1.07 KB
/
StatementGenerator.php
File metadata and controls
50 lines (41 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* @see https://github.com/open-code-modeling/php-code-ast for the canonical source repository
* @copyright https://github.com/open-code-modeling/php-code-ast/blob/master/COPYRIGHT.md
* @license https://github.com/open-code-modeling/php-code-ast/blob/master/LICENSE.md MIT License
*/
declare(strict_types=1);
namespace OpenCodeModeling\CodeAst\Node;
use OpenCodeModeling\CodeAst\IdentifiedStatementGenerator;
use PhpParser\Node;
final class StatementGenerator implements IdentifiedStatementGenerator
{
/**
* @var string
**/
private $identifier;
/**
* @var array<Node\Stmt>
**/
private $stmts;
/**
* @param string $identifier
* @param Node\Stmt ...$stmts
*/
public function __construct(string $identifier, Node\Stmt ...$stmts)
{
$this->identifier = $identifier;
$this->stmts = $stmts;
}
/**
* @return string
*/
public function identifier(): string
{
return $this->identifier;
}
public function generate()
{
return $this->stmts;
}
}