@@ -11,8 +11,7 @@ |
||
| 11 | 11 | * |
| 12 | 12 | * @author Jakub Konečný |
| 13 | 13 | */ |
| 14 | -final class ChainLocaleResolver extends Collection implements LocaleResolver |
|
| 15 | -{ |
|
| 14 | +final class ChainLocaleResolver extends Collection implements LocaleResolver { |
|
| 16 | 15 | protected string $class = LocaleResolver::class; |
| 17 | 16 | |
| 18 | 17 | public function resolve(): ?string |
@@ -12,8 +12,7 @@ |
||
| 12 | 12 | * |
| 13 | 13 | * @author Jakub Konečný |
| 14 | 14 | */ |
| 15 | -final class FallbackLocaleResolver implements LocaleResolver |
|
| 16 | -{ |
|
| 15 | +final class FallbackLocaleResolver implements LocaleResolver { |
|
| 17 | 16 | /** |
| 18 | 17 | * Resolve language |
| 19 | 18 | * |
@@ -14,13 +14,11 @@ |
||
| 14 | 14 | * |
| 15 | 15 | * @author Jakub Konečný |
| 16 | 16 | */ |
| 17 | -final class HeaderLocaleResolver implements LoaderAwareLocaleResolver |
|
| 18 | -{ |
|
| 17 | +final class HeaderLocaleResolver implements LoaderAwareLocaleResolver { |
|
| 19 | 18 | private ?Loader $loader = null; |
| 20 | 19 | private IRequest $request; |
| 21 | 20 | |
| 22 | - public function __construct(IRequest $request = null) |
|
| 23 | - { |
|
| 21 | + public function __construct(IRequest $request = null) { |
|
| 24 | 22 | if ($request === null) { |
| 25 | 23 | $request = (new RequestFactory())->fromGlobals(); |
| 26 | 24 | } |
@@ -11,8 +11,7 @@ |
||
| 11 | 11 | * |
| 12 | 12 | * @author Jakub Konečný |
| 13 | 13 | */ |
| 14 | -final class ManualLocaleResolver implements SettableLocaleResolver |
|
| 15 | -{ |
|
| 14 | +final class ManualLocaleResolver implements SettableLocaleResolver { |
|
| 16 | 15 | public ?string $lang = null; |
| 17 | 16 | |
| 18 | 17 | /** |
@@ -3,10 +3,10 @@ |
||
| 3 | 3 | |
| 4 | 4 | namespace Nexendrie\Translation; |
| 5 | 5 | |
| 6 | -if (false) { // @phpstan-ignore if.alwaysFalse |
|
| 6 | +if (false) { |
|
| 7 | +// @phpstan-ignore if.alwaysFalse |
|
| 7 | 8 | /** @deprecated Use LoaderAwareLocaleResolver */ |
| 8 | - interface ILoaderAwareLocaleResolver extends LoaderAwareLocaleResolver |
|
| 9 | - { |
|
| 9 | + interface ILoaderAwareLocaleResolver extends LoaderAwareLocaleResolver { |
|
| 10 | 10 | } |
| 11 | 11 | } elseif (!interface_exists(ILoaderAwareLocaleResolver::class)) { |
| 12 | 12 | class_alias(LoaderAwareLocaleResolver::class, ILoaderAwareLocaleResolver::class); |
@@ -3,10 +3,10 @@ |
||
| 3 | 3 | |
| 4 | 4 | namespace Nexendrie\Translation; |
| 5 | 5 | |
| 6 | -if (false) { // @phpstan-ignore if.alwaysFalse |
|
| 6 | +if (false) { |
|
| 7 | +// @phpstan-ignore if.alwaysFalse |
|
| 7 | 8 | /** @deprecated Use FileLoader */ |
| 8 | - interface IFileLoader extends FileLoader |
|
| 9 | - { |
|
| 9 | + interface IFileLoader extends FileLoader { |
|
| 10 | 10 | } |
| 11 | 11 | } elseif (!interface_exists(IFileLoader::class)) { |
| 12 | 12 | class_alias(FileLoader::class, IFileLoader::class); |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | * |
| 9 | 9 | * @author Jakub Konečný |
| 10 | 10 | */ |
| 11 | -interface LoaderAwareLocaleResolver extends LocaleResolver |
|
| 12 | -{ |
|
| 11 | +interface LoaderAwareLocaleResolver extends LocaleResolver { |
|
| 13 | 12 | public function setLoader(Loader $loader): void; |
| 14 | 13 | } |
@@ -3,10 +3,10 @@ |
||
| 3 | 3 | |
| 4 | 4 | namespace Nexendrie\Translation; |
| 5 | 5 | |
| 6 | -if (false) { // @phpstan-ignore if.alwaysFalse |
|
| 6 | +if (false) { |
|
| 7 | +// @phpstan-ignore if.alwaysFalse |
|
| 7 | 8 | /** @deprecated Use LocaleResolver */ |
| 8 | - interface ILocaleResolver extends LocaleResolver |
|
| 9 | - { |
|
| 9 | + interface ILocaleResolver extends LocaleResolver { |
|
| 10 | 10 | } |
| 11 | 11 | } elseif (!interface_exists(ILocaleResolver::class)) { |
| 12 | 12 | class_alias(LocaleResolver::class, ILocaleResolver::class); |
@@ -11,8 +11,7 @@ |
||
| 11 | 11 | * |
| 12 | 12 | * @author Jakub Konečný |
| 13 | 13 | */ |
| 14 | -final class MessageSelector implements IMessageSelector |
|
| 15 | -{ |
|
| 14 | +final class MessageSelector implements IMessageSelector { |
|
| 16 | 15 | public function isMultiChoice(string $message): bool |
| 17 | 16 | { |
| 18 | 17 | return is_string(Intervals::findInterval($message)) && str_contains($message, "|"); |