Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5988305
Section.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
773 B
Referenced Files
None
Subscribers
None
Section.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
MediaWiki\Extension\Translate\PageTranslation
;
/**
* Section is one pair of <translate>...</translate> tags.
* @author Niklas Laxström
* @license GPL-2.0-or-later
* @since 2020.08
*/
class
Section
{
private
string
$open
;
private
string
$contents
;
private
string
$close
;
public
function
__construct
(
string
$open
,
string
$contents
,
string
$close
)
{
$this
->
open
=
$open
;
$this
->
contents
=
$contents
;
$this
->
close
=
$close
;
}
public
function
contents
():
string
{
// If <translate> tags are on their own line, avoid build-up of newlines
return
preg_replace
(
'/
\A\n
|
\n\z
/'
,
''
,
$this
->
contents
);
}
public
function
wrappedContents
():
string
{
return
$this
->
open
.
$this
->
contents
.
$this
->
close
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Oct 4, 00:45 (3 w, 7 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
c0/03/56ae09773193f4e4d7978e9468c7
Default Alt Text
Section.php (773 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment