Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5974584
Box.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
Box.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
MediaWiki\Extension\Math\WikiTexVC\Nodes
;
use
MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmrow
;
use
MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmtext
;
class
Box
extends
TexNode
{
/** @var string */
private
$fname
;
/** @var string */
private
$arg
;
public
function
__construct
(
string
$fname
,
string
$arg
)
{
parent
::
__construct
(
$fname
,
$arg
);
$this
->
fname
=
$fname
;
$this
->
arg
=
$arg
;
}
/**
* @return string
*/
public
function
getFname
():
string
{
return
$this
->
fname
;
}
/**
* @return string
*/
public
function
getArg
():
string
{
return
$this
->
arg
;
}
/** @inheritDoc */
public
function
inCurlies
()
{
return
$this
->
render
();
}
/** @inheritDoc */
public
function
render
()
{
return
'{'
.
$this
->
fname
.
'{'
.
$this
->
arg
.
'}}'
;
}
/** @inheritDoc */
public
function
renderMML
(
$arguments
=
[],
&
$state
=
[]
)
{
$mrow
=
new
MMLmrow
();
$mtext
=
new
MMLmtext
();
$arg
=
$this
->
getArg
();
if
(
strlen
(
$arg
)
>=
1
)
{
// Replace trailing and leading spaces with special space sign
if
(
substr
(
$arg
,
-
1
,
1
)
===
" "
)
{
$arg
=
rtrim
(
$arg
,
" "
)
.
" "
;
}
if
(
substr
(
$arg
,
0
,
1
)
==
" "
)
{
$arg
=
" "
.
ltrim
(
$arg
,
" "
);
}
}
return
$mrow
->
encapsulateRaw
(
$mtext
->
encapsulateRaw
(
$arg
)
);
}
/** @inheritDoc */
public
function
extractIdentifiers
(
$args
=
null
)
{
return
[];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 17:32 (1 d, 20 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
cf/5f/ba4492fe7b766978cbc5545140fe
Default Alt Text
Box.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment