Page MenuHomeWickedGov Phorge

NodeAttributes.php
No OneTemporary

Size
682 B
Referenced Files
None
Subscribers
None

NodeAttributes.php

<?php declare(strict_types = 1);
namespace PHPStan\PhpDocParser\Ast;
use function array_key_exists;
trait NodeAttributes
{
/** @var array<string, mixed> */
private array $attributes = [];
/**
* @param mixed $value
*/
public function setAttribute(string $key, $value): void
{
if ($value === null) {
unset($this->attributes[$key]);
return;
}
$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;
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, Oct 3, 22:36 (1 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
cc/5e/0a2f8c5f965336824111de1e9f17
Default Alt Text
NodeAttributes.php (682 B)

Event Timeline