Page MenuHomeWickedGov Phorge

Section.php
No OneTemporary

Size
773 B
Referenced Files
None
Subscribers
None

Section.php

<?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

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)

Event Timeline