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

37 lines
971 B
PHP
Raw Normal View History

2024-05-07 12:17:25 +02:00
<?php declare(strict_types=1);
namespace PhpParser\Node;
use PhpParser\NodeAbstract;
2024-05-17 12:24:19 +00:00
class Const_ extends NodeAbstract {
2024-05-07 12:17:25 +02:00
/** @var Identifier Name */
2024-05-17 12:24:19 +00:00
public Identifier $name;
2024-05-07 12:17:25 +02:00
/** @var Expr Value */
2024-05-17 12:24:19 +00:00
public Expr $value;
2024-05-07 12:17:25 +02:00
2024-05-17 12:24:19 +00:00
/** @var Name|null Namespaced name (if using NameResolver) */
public ?Name $namespacedName;
2024-05-07 12:17:25 +02:00
/**
* Constructs a const node for use in class const and const statements.
*
2024-05-17 12:24:19 +00:00
* @param string|Identifier $name Name
* @param Expr $value Value
* @param array<string, mixed> $attributes Additional attributes
2024-05-07 12:17:25 +02:00
*/
public function __construct($name, Expr $value, array $attributes = []) {
$this->attributes = $attributes;
$this->name = \is_string($name) ? new Identifier($name) : $name;
$this->value = $value;
}
2024-05-17 12:24:19 +00:00
public function getSubNodeNames(): array {
2024-05-07 12:17:25 +02:00
return ['name', 'value'];
}
2024-05-17 12:24:19 +00:00
public function getType(): string {
2024-05-07 12:17:25 +02:00
return 'Const';
}
}