Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5980286
ShapeItem.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
ShapeItem.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
phpDocumentor\Reflection\PseudoTypes
;
use
phpDocumentor\Reflection\Type
;
use
phpDocumentor\Reflection\Types\Mixed_
;
use
function
sprintf
;
abstract
class
ShapeItem
{
/** @var string|null */
private
$key
;
/** @var Type */
private
$value
;
/** @var bool */
private
$optional
;
public
function
__construct
(?
string
$key
,
?
Type
$value
,
bool
$optional
)
{
$this
->
key
=
$key
;
$this
->
value
=
$value
??
new
Mixed_
();
$this
->
optional
=
$optional
;
}
public
function
getKey
():
?
string
{
return
$this
->
key
;
}
public
function
getValue
():
Type
{
return
$this
->
value
;
}
public
function
isOptional
():
bool
{
return
$this
->
optional
;
}
public
function
__toString
():
string
{
if
(
$this
->
key
!==
null
)
{
return
sprintf
(
'%s%s: %s'
,
$this
->
key
,
$this
->
optional
?
'?'
:
''
,
(
string
)
$this
->
value
);
}
return
(
string
)
$this
->
value
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 21:19 (1 w, 14 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
30/7e/96e4fed4ebb83028fe15b7ebd3f7
Default Alt Text
ShapeItem.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment