trait NodeAttributes
Hierarchy
- trait \PHPStan\PhpDocParser\Ast\NodeAttributes
67 files declare their use of NodeAttributes
- ArrayShapeItemNode.php in vendor/
phpstan/ phpdoc-parser/ src/ Ast/ Type/ ArrayShapeItemNode.php - ArrayShapeNode.php in vendor/
phpstan/ phpdoc-parser/ src/ Ast/ Type/ ArrayShapeNode.php - ArrayShapeUnsealedTypeNode.php in vendor/
phpstan/ phpdoc-parser/ src/ Ast/ Type/ ArrayShapeUnsealedTypeNode.php - ArrayTypeNode.php in vendor/
phpstan/ phpdoc-parser/ src/ Ast/ Type/ ArrayTypeNode.php - AssertTagMethodValueNode.php in vendor/
phpstan/ phpdoc-parser/ src/ Ast/ PhpDoc/ AssertTagMethodValueNode.php
File
-
vendor/
phpstan/ phpdoc-parser/ src/ Ast/ NodeAttributes.php, line 7
Namespace
PHPStan\PhpDocParser\AstView source
trait NodeAttributes {
/** @var array<string, mixed> */
private $attributes = [];
/**
* @param mixed $value
*/
public function setAttribute(string $key, $value) : void {
$this->attributes[$key] = $value;
}
public function hasAttribute(string $key) : bool {
return array_key_exists($key, $this->attributes);
}
/**
* @return mixed
*/
public function getAttribute(string $key) {
if ($this->hasAttribute($key)) {
return $this->attributes[$key];
}
return null;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
NodeAttributes::$attributes | private | property | @var array<string, mixed> |
NodeAttributes::getAttribute | public | function | * |
NodeAttributes::hasAttribute | public | function | |
NodeAttributes::setAttribute | public | function | * |