Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7486768
ElementContext.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ElementContext.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Phan\Language
;
use
Phan\CodeBase
;
use
Phan\Language\Element\AddressableElement
;
use
Phan\Language\Element\TypedElement
;
/**
* A context referring to an element that hasn't been created yet.
* This is used when issues can be emitted before an object is added to the codebase.
*/
class
ElementContext
extends
Context
{
/** @var ?AddressableElement $element */
private
$element
;
public
function
__construct
(
AddressableElement
$element
)
{
$this
->
copyPropertiesFrom
(
$element
->
getContext
());
$this
->
element
=
$element
;
}
public
function
isInElementScope
():
bool
{
return
true
;
}
/**
* Manually free the element reference to avoid the gc loop of
* Element -> Parameter -> ElementContext -> Element
*
* (Phan runs without garbage collection for performance reasons)
*/
public
function
freeElementReference
():
void
{
$this
->
element
=
null
;
}
public
function
getElementInScope
(
CodeBase
$code_base
):
TypedElement
{
return
$this
->
element
??
parent
::
getElementInScope
(
$code_base
);
}
public
function
isInGlobalScope
():
bool
{
return
false
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Nov 23, 15:37 (1 w, 11 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
f6/65/d04da9f89113d8a77b84ae6612b6
Default Alt Text
ElementContext.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment