Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4055469
LengthSpec.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
791 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
Aug 16 2026, 01:00 (12 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
f6/dd/fb8a3d5fa422f84e640f02aae552
Default Alt Text
LengthSpec.php (791 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment