Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7467566
ScalarRawType.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
ScalarRawType.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Phan\Language\Type
;
/**
* A temporary representation of the type `scalar`.
* These are the types for which `is_scalar(expr)` is true
*
* This is used in the middle of parsing PHPDoc types,
* but is quickly converted to bool|int|float|string once parsing is finished.
* @phan-pure
*/
final
class
ScalarRawType
extends
ScalarType
implements
MultiType
{
use
NativeTypeTrait
;
/** @override */
public
const
NAME
=
'scalar'
;
/**
* @return array{0:BoolType,1:IntType,2:FloatType,3:StringType}
*/
public
function
asIndividualTypeInstances
():
array
{
if
(
$this
->
is_nullable
)
{
static
$nullable_types
=
null
;
if
(
$nullable_types
===
null
)
{
$nullable_types
=
[
BoolType
::
instance
(
true
),
IntType
::
instance
(
true
),
FloatType
::
instance
(
true
),
StringType
::
instance
(
true
)];
}
return
$nullable_types
;
}
static
$nonnullable_types
=
null
;
if
(
$nonnullable_types
===
null
)
{
$nonnullable_types
=
[
BoolType
::
instance
(
false
),
IntType
::
instance
(
false
),
FloatType
::
instance
(
false
),
StringType
::
instance
(
false
)];
}
return
$nonnullable_types
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Nov 23, 06:09 (3 d, 11 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
70/ee/e3b96afbfb7fd7fc009761af83eb
Default Alt Text
ScalarRawType.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment