@@ -46,8 +46,7 @@ |
||
| 46 | 46 | * @author Jakub Konečný |
| 47 | 47 | * @method \stdClass getConfig() |
| 48 | 48 | */ |
| 49 | -final class TranslationExtension extends CompilerExtension |
|
| 50 | -{ |
|
| 49 | +final class TranslationExtension extends CompilerExtension { |
|
| 51 | 50 | /** @internal */ |
| 52 | 51 | public const SERVICE_TRANSLATOR = "translator"; |
| 53 | 52 | /** @internal */ |
@@ -12,10 +12,8 @@ |
||
| 12 | 12 | * |
| 13 | 13 | * @author Jakub Konečný |
| 14 | 14 | */ |
| 15 | -final class TranslationPanel implements IBarPanel |
|
| 16 | -{ |
|
| 17 | - public function __construct(private readonly Translator $translator, private readonly Loader $loader) |
|
| 18 | - { |
|
| 15 | +final class TranslationPanel implements IBarPanel { |
|
| 16 | + public function __construct(private readonly Translator $translator, private readonly Loader $loader) { |
|
| 19 | 17 | } |
| 20 | 18 | |
| 21 | 19 | public function getTab(): string |
@@ -3,10 +3,10 @@ |
||
| 3 | 3 | |
| 4 | 4 | namespace Nexendrie\Translation\Bridges\NetteApplication; |
| 5 | 5 | |
| 6 | -if (false) { // @phpstan-ignore if.alwaysFalse |
|
| 6 | +if (false) { |
|
| 7 | +// @phpstan-ignore if.alwaysFalse |
|
| 7 | 8 | /** @deprecated Use AppRequestAwareLocaleResolver */ |
| 8 | - interface IAppRequestAwareLocaleResolver extends AppRequestAwareLocaleResolver |
|
| 9 | - { |
|
| 9 | + interface IAppRequestAwareLocaleResolver extends AppRequestAwareLocaleResolver { |
|
| 10 | 10 | } |
| 11 | 11 | } elseif (!interface_exists(IAppRequestAwareLocaleResolver::class)) { |
| 12 | 12 | class_alias(AppRequestAwareLocaleResolver::class, IAppRequestAwareLocaleResolver::class); |
@@ -11,8 +11,7 @@ |
||
| 11 | 11 | * |
| 12 | 12 | * @author Jakub Konečný |
| 13 | 13 | */ |
| 14 | -final class ParamLocaleResolver implements AppRequestAwareLocaleResolver |
|
| 15 | -{ |
|
| 14 | +final class ParamLocaleResolver implements AppRequestAwareLocaleResolver { |
|
| 16 | 15 | private ?Request $request = null; |
| 17 | 16 | /** @var string */ |
| 18 | 17 | public string $param = "locale"; |
@@ -12,7 +12,6 @@ |
||
| 12 | 12 | * |
| 13 | 13 | * @author Jakub Konečný |
| 14 | 14 | */ |
| 15 | -interface AppRequestAwareLocaleResolver extends LocaleResolver |
|
| 16 | -{ |
|
| 15 | +interface AppRequestAwareLocaleResolver extends LocaleResolver { |
|
| 17 | 16 | public function onRequest(Application $application, Request $request): void; |
| 18 | 17 | } |
@@ -8,6 +8,5 @@ |
||
| 8 | 8 | * |
| 9 | 9 | * @author Jakub Konečný |
| 10 | 10 | */ |
| 11 | -class InvalidMessageSelectorException extends InvalidStateException |
|
| 12 | -{ |
|
| 11 | +class InvalidMessageSelectorException extends InvalidStateException { |
|
| 13 | 12 | } |
@@ -3,6 +3,5 @@ |
||
| 3 | 3 | |
| 4 | 4 | namespace Nexendrie\Translation; |
| 5 | 5 | |
| 6 | -class FolderNotSetException extends InvalidStateException |
|
| 7 | -{ |
|
| 6 | +class FolderNotSetException extends InvalidStateException { |
|
| 8 | 7 | } |
@@ -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 SettableLocaleResolver */ |
| 8 | - interface ISettableLocaleResolver extends SettableLocaleResolver |
|
| 9 | - { |
|
| 9 | + interface ISettableLocaleResolver extends SettableLocaleResolver { |
|
| 10 | 10 | } |
| 11 | 11 | } elseif (!interface_exists(ISettableLocaleResolver::class)) { |
| 12 | 12 | class_alias(SettableLocaleResolver::class, ISettableLocaleResolver::class); |
@@ -15,16 +15,14 @@ |
||
| 15 | 15 | * @author Jakub Konečný |
| 16 | 16 | * @property string|null $lang |
| 17 | 17 | */ |
| 18 | -final class SessionLocaleResolver implements SettableLocaleResolver |
|
| 19 | -{ |
|
| 18 | +final class SessionLocaleResolver implements SettableLocaleResolver { |
|
| 20 | 19 | use \Nette\SmartObject; |
| 21 | 20 | |
| 22 | 21 | private readonly Session $session; |
| 23 | 22 | private readonly SessionSection $section; |
| 24 | 23 | public string $varName = "lang"; |
| 25 | 24 | |
| 26 | - public function __construct(Session $session = null) |
|
| 27 | - { |
|
| 25 | + public function __construct(Session $session = null) { |
|
| 28 | 26 | if ($session === null) { |
| 29 | 27 | $request = (new RequestFactory())->fromGlobals(); |
| 30 | 28 | $response = new Response(); |