Translate extension for MediaWiki
Loading...
Searching...
No Matches
TranslatablePageStatus.php
1
<?php
2
declare( strict_types = 1 );
3
4
namespace
MediaWiki\Extension\Translate\PageTranslation;
5
6
use InvalidArgumentException;
7
use
MediaWiki\Extension\Translate\MessageGroupProcessing\TranslatableBundleStatus
;
8
15
class
TranslatablePageStatus
implements
TranslatableBundleStatus
{
16
public
const
PROPOSED = 1;
17
public
const
ACTIVE = 2;
18
public
const
OUTDATED = 3;
19
public
const
BROKEN = 4;
20
21
private
int
$status;
22
23
public
function
__construct(
int
$status ) {
24
if
( !in_array( $status, [ self::PROPOSED, self::ACTIVE, self::OUTDATED, self::BROKEN ] ) ) {
25
throw
new
InvalidArgumentException(
"Invalid status: $status"
);
26
}
27
$this->status = $status;
28
}
29
30
public
function
isEqual(
int
$status ):
bool
{
31
return
$this->status === $status;
32
}
33
34
public
function
getId():
int
{
35
return
$this->status;
36
}
37
}
MediaWiki\Extension\Translate\PageTranslation\TranslatablePageStatus
Stores and validates possible statuses for TranslatablePage.
Definition
TranslatablePageStatus.php:15
MediaWiki\Extension\Translate\MessageGroupProcessing\TranslatableBundleStatus
Definition
TranslatableBundleStatus.php:6
src
PageTranslation
TranslatablePageStatus.php
Generated by
1.10.0