Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7458151
PropertyScope.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
PropertyScope.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Phan\Language\Scope
;
use
Phan\Language\FQSEN\FullyQualifiedClassName
;
use
Phan\Language\FQSEN\FullyQualifiedPropertyName
;
use
Phan\Language\Scope
;
/**
* Represents the Scope of the Context of a class's property declaration.
*/
class
PropertyScope
extends
ClosedScope
{
public
function
__construct
(
Scope
$parent_scope
,
FullyQualifiedPropertyName
$fqsen
)
{
$this
->
parent_scope
=
$parent_scope
;
$this
->
fqsen
=
$fqsen
;
$this
->
flags
=
$parent_scope
->
flags
;
}
/**
* @return bool
* True if we're in a property scope
* @override
*/
public
function
isInPropertyScope
():
bool
{
return
true
;
}
/**
* @return bool
* True if we're in a class scope (True for properties)
* @override
*/
public
function
isInClassScope
():
bool
{
return
true
;
}
/**
* @return FullyQualifiedPropertyName
* Get the FullyQualifiedPropertyName of the class whose scope
* we're in.
* @override
*/
public
function
getPropertyFQSEN
():
FullyQualifiedPropertyName
{
if
(
$this
->
fqsen
instanceof
FullyQualifiedPropertyName
)
{
return
$this
->
fqsen
;
}
throw
new
\AssertionError
(
"FQSEN must be a FullyQualifiedPropertyName"
);
}
/**
* @return FullyQualifiedClassName
* Crawl the scope hierarchy to get a class FQSEN.
*/
public
function
getClassFQSEN
():
FullyQualifiedClassName
{
return
$this
->
parent_scope
->
getClassFQSEN
();
}
/**
* @return ?FullyQualifiedClassName
* Crawl the scope hierarchy to get a class FQSEN.
* Return null if there is no class FQSEN.
*/
public
function
getClassFQSENOrNull
():
?
FullyQualifiedClassName
{
return
$this
->
parent_scope
->
getClassFQSENOrNull
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Nov 23, 01:17 (2 d, 18 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
b9/5e/b441752c8118350b7376f98d5349
Default Alt Text
PropertyScope.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment