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

37 lines
1014 B
PHP
Raw Normal View History

2024-05-07 12:17:25 +02:00
<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
2024-05-17 12:24:19 +00:00
use PhpParser\Node;
2024-05-07 12:17:25 +02:00
use PhpParser\Node\Expr;
use PhpParser\Node\Name;
use PhpParser\Node\VarLikeIdentifier;
2024-05-17 12:24:19 +00:00
class StaticPropertyFetch extends Expr {
2024-05-07 12:17:25 +02:00
/** @var Name|Expr Class name */
2024-05-17 12:24:19 +00:00
public Node $class;
2024-05-07 12:17:25 +02:00
/** @var VarLikeIdentifier|Expr Property name */
2024-05-17 12:24:19 +00:00
public Node $name;
2024-05-07 12:17:25 +02:00
/**
* Constructs a static property fetch node.
*
2024-05-17 12:24:19 +00:00
* @param Name|Expr $class Class name
* @param string|VarLikeIdentifier|Expr $name Property name
* @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(Node $class, $name, array $attributes = []) {
2024-05-07 12:17:25 +02:00
$this->attributes = $attributes;
$this->class = $class;
$this->name = \is_string($name) ? new VarLikeIdentifier($name) : $name;
}
2024-05-17 12:24:19 +00:00
public function getSubNodeNames(): array {
2024-05-07 12:17:25 +02:00
return ['class', 'name'];
}
2024-05-17 12:24:19 +00:00
public function getType(): string {
2024-05-07 12:17:25 +02:00
return 'Expr_StaticPropertyFetch';
}
}