Page MenuHomeWickedGov Phorge

GlobalVariable.php
No OneTemporary

Size
770 B
Referenced Files
None
Subscribers
None

GlobalVariable.php

<?php
declare(strict_types=1);
namespace Phan\Language\Element;
use Phan\Language\UnionType;
/**
* This class represents a global variable in a local scope, allowing to partially
* proxy write reference to the global object.
*/
class GlobalVariable extends Variable
{
use ElementProxyTrait;
public function getName(): string
{
return $this->element->getName();
}
public function setUnionType(UnionType $type): void
{
$this->type = $type;
// Always merge the type on the actual global.
// Convert undefined to null before merging in the type.
$this->element->setUnionType($this->element->getUnionType()->withUnionType($type->eraseRealTypeSetRecursively())->withIsPossiblyUndefined(false));
}
}

File Metadata

Mime Type
text/x-php
Expires
Sun, Nov 22, 20:06 (1 d, 22 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
b7/9f/6bf0b288ddf45806e16a5e9d2a59
Default Alt Text
GlobalVariable.php (770 B)

Event Timeline