Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1431987
None.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
None.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Phan\Library
;
use
Exception
;
/**
* This represents the absence of a value in an Option.
*
* @inherits Option<null>
* @phan-pure
*/
final
class
None
extends
Option
{
/**
* Get a new instance of nothing
*/
private
function
__construct
()
{
}
/** @var None */
private
static
$instance
;
/**
* Fetches the shared instance of None.
*/
public
static
function
instance
():
None
{
return
self
::
$instance
;
}
public
function
isDefined
():
bool
{
return
false
;
}
/**
* @template E
* @param E $else
* @return E
* @suppress PhanParamSignatureMismatch
*/
public
function
getOrElse
(
$else
)
{
return
$else
;
}
/**
* @return never
* @throws Exception to indicate that get() was called without checking for a value.
*/
public
function
get
()
{
throw
new
Exception
(
"Cannot call get on None"
);
}
/**
* @return string
* A string representation of this object
*/
public
function
__tostring
():
string
{
return
'None()'
;
}
/**
* Called automatically to instantiate shared instance
* @internal
*/
public
static
function
init
():
void
{
self
::
$instance
=
new
None
();
}
}
None
::
init
();
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 21:18 (1 d, 14 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1a/4a/da9c8f75c0728c0ffb6748f5e43b
Default Alt Text
None.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment