- Create GlobalConstantDef entity to store namespace/global constant metadata - Add properties for type, codegenFinalized, initialization code, and name - Include constructor with parameters for value expression and source details - Implement metadata collection during preprocessing functionalitymaster
parent
d8267c2f00
commit
9671641629
1 changed files with 27 additions and 0 deletions
@ -0,0 +1,27 @@ |
||||
<?php |
||||
|
||||
namespace TypePhp\Entity; |
||||
|
||||
use PhpParser\Node; |
||||
|
||||
/** Metadata for a namespace/global constant collected during preprocessing. */ |
||||
final class GlobalConstantDef |
||||
{ |
||||
public string $type; |
||||
public bool $codegenFinalized; |
||||
public string $initializationCode = ''; |
||||
public string $afterInitializationCode = ''; |
||||
|
||||
public function __construct( |
||||
public string $name, |
||||
public string $value, |
||||
public ?Node\Expr $valueExpr, |
||||
public string $namespace, |
||||
public string $sourceFile, |
||||
string $type, |
||||
bool $codegenFinalized, |
||||
) { |
||||
$this->type = $type; |
||||
$this->codegenFinalized = $codegenFinalized; |
||||
} |
||||
} |
||||
Loading…
Reference in new issue