diff options
| author | 2023-04-14 23:08:38 +0200 | |
|---|---|---|
| committer | 2023-04-14 23:08:38 +0200 | |
| commit | b8662f88995df2cbae655d4efe8f414eb3872e5e (patch) | |
| tree | 4248d2d9b91016de3df3f699537a6bf39dabc754 /cli/i18n/I18nValue.php | |
| parent | b3121709d62d9fadf890e523b9c9dba7cf702d25 (diff) | |
PHPstan level 6 for I18nFile.php (#5291)
* PHPstan level 6 for I18nFile.php
* Minor syntax
* PHPstan level 6 for I18nFiles
* PHPstan level 6 for I18nFiles
* PHPstan level 6 for I18n Files
* PHPstan level 6 for I18n Files
* Fix several type errors
---------
Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'cli/i18n/I18nValue.php')
| -rw-r--r-- | cli/i18n/I18nValue.php | 28 |
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; } } |
