Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5970475
LengthSpec.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
793 B
Referenced Files
None
Subscribers
None
LengthSpec.php
View Options
<?php
namespace
MediaWiki\Extension\Math\WikiTexVC\Nodes
;
use
InvalidArgumentException
;
class
LengthSpec
extends
TexNode
{
private
string
$sign
;
private
string
$unit
;
private
string
$number
;
public
function
__construct
(
?
string
$sign
,
array
$number
,
string
$unit
)
{
$this
->
sign
=
$sign
??
''
;
$this
->
unit
=
$unit
;
if
(
count
(
$number
)
===
3
)
{
$this
->
number
=
implode
(
$number
[
0
]
)
.
(
$number
[
1
]
??
''
)
.
implode
(
$number
[
2
]
);
}
elseif
(
count
(
$number
)
===
2
)
{
$this
->
number
=
(
$number
[
0
]
??
''
)
.
implode
(
$number
[
1
]
);
}
else
{
throw
new
InvalidArgumentException
(
'Invalid number in length spec'
);
}
parent
::
__construct
();
}
/** @inheritDoc */
public
function
render
()
{
return
'['
.
$this
->
sign
.
$this
->
number
.
$this
->
unit
.
']'
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 14:30 (10 m, 4 s)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
b1/97/e6499139b6fe6e6e0b7499bdb737
Default Alt Text
LengthSpec.php (793 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment