Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F13144187
None.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
926 B
Referenced Files
None
Subscribers
None
None.php
View Options
<?php
namespace
Keruald\OmniTools\DataTypes\Option
;
use
InvalidArgumentException
;
class
None
extends
Option
{
public
function
isSome
()
:
bool
{
return
false
;
}
public
function
isNone
()
:
bool
{
return
true
;
}
public
function
getValue
()
:
mixed
{
throw
new
InvalidArgumentException
(
<<<'EOD'
This option is a none, so it doesn't have a value.
You can check first with isSome() if this is a value.
EOD
);
}
public
function
map
(
callable
$callable
)
:
Option
{
return
$this
;
}
public
function
or
(
Option
$default
)
:
Option
{
return
$default
;
}
public
function
orElse
(
callable
$callable
)
:
Option
{
return
$callable
();
}
public
function
getValueOr
(
mixed
$default
)
:
mixed
{
return
$default
;
}
public
function
getValueOrElse
(
callable
$callable
)
:
mixed
{
return
$callable
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Nov 21, 16:57 (15 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3173027
Default Alt Text
None.php (926 B)
Attached To
Mode
rKOT Keruald OmniTools
Attached
Detach File
Event Timeline
Log In to Comment