aboutsummaryrefslogtreecommitdiff
path: root/cli/i18n/I18nValue.php
diff options
context:
space:
mode:
Diffstat (limited to 'cli/i18n/I18nValue.php')
-rw-r--r--cli/i18n/I18nValue.php28
1 files changed, 15 insertions, 13 deletions
diff --git a/cli/i18n/I18nValue.php b/cli/i18n/I18nValue.php
index 8ca843b26..c4746de03 100644
--- a/cli/i18n/I18nValue.php
+++ b/cli/i18n/I18nValue.php
@@ -1,16 +1,18 @@
<?php
class I18nValue {
- const STATE_DIRTY = 'dirty';
- const STATE_IGNORE = 'ignore';
- const STATE_TODO = 'todo';
- const STATES = [
+ private const STATE_DIRTY = 'dirty';
+ public const STATE_IGNORE = 'ignore';
+ private const STATE_TODO = 'todo';
+ private const STATES = [
self::STATE_DIRTY,
self::STATE_IGNORE,
self::STATE_TODO,
];
+ /** @var string */
private $value;
+ /** @var string|null */
private $state;
public function __construct(string $data) {
@@ -31,37 +33,37 @@ class I18nValue {
$this->markAsTodo();
}
- public function equal(I18nValue $value) {
+ public function equal(I18nValue $value): bool {
return $this->value === $value->getValue();
}
- public function isIgnore() {
+ public function isIgnore(): bool {
return $this->state === self::STATE_IGNORE;
}
- public function isTodo() {
+ public function isTodo(): bool {
return $this->state === self::STATE_TODO;
}
- public function markAsDirty() {
+ public function markAsDirty(): void {
$this->state = self::STATE_DIRTY;
}
- public function markAsIgnore() {
+ public function markAsIgnore(): void {
$this->state = self::STATE_IGNORE;
}
- public function markAsTodo() {
+ public function markAsTodo(): void {
$this->state = self::STATE_TODO;
}
- public function unmarkAsIgnore() {
+ public function unmarkAsIgnore(): void {
if ($this->state === self::STATE_IGNORE) {
$this->state = null;
}
}
- public function __toString() {
+ public function __toString(): string {
if ($this->state === null) {
return $this->value;
}
@@ -69,7 +71,7 @@ class I18nValue {
return "{$this->value} -> {$this->state}";
}
- public function getValue() {
+ public function getValue(): string {
return $this->value;
}
}