@@ -52,8 +52,7 @@ discard block |
||
| 52 | 52 | * @class Lang |
| 53 | 53 | * @package Platine\Lang |
| 54 | 54 | */ |
| 55 | -class Lang |
|
| 56 | -{ |
|
| 55 | +class Lang { |
|
| 57 | 56 | /** |
| 58 | 57 | * The translator instance |
| 59 | 58 | * @var TranslatorInterface |
@@ -64,8 +63,7 @@ discard block |
||
| 64 | 63 | * Create new instance |
| 65 | 64 | * @param TranslatorInterface $translator |
| 66 | 65 | */ |
| 67 | - public function __construct(TranslatorInterface $translator) |
|
| 68 | - { |
|
| 66 | + public function __construct(TranslatorInterface $translator) { |
|
| 69 | 67 | $this->translator = $translator; |
| 70 | 68 | } |
| 71 | 69 | |
@@ -52,8 +52,7 @@ |
||
| 52 | 52 | * @class Configuration |
| 53 | 53 | * @package Platine\Lang |
| 54 | 54 | */ |
| 55 | -class Configuration extends AbstractConfiguration |
|
| 56 | -{ |
|
| 55 | +class Configuration extends AbstractConfiguration { |
|
| 57 | 56 | /** |
| 58 | 57 | * {@inheritdoc} |
| 59 | 58 | */ |
@@ -54,8 +54,7 @@ |
||
| 54 | 54 | * @class BaseTranslator |
| 55 | 55 | * @package Platine\Lang\Translator |
| 56 | 56 | */ |
| 57 | -abstract class BaseTranslator implements TranslatorInterface |
|
| 58 | -{ |
|
| 57 | +abstract class BaseTranslator implements TranslatorInterface { |
|
| 59 | 58 | /** |
| 60 | 59 | * The configuration instance |
| 61 | 60 | * @var Configuration |
@@ -121,16 +121,16 @@ discard block |
||
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
| 124 | - * {@inhereitdoc} |
|
| 125 | - */ |
|
| 124 | + * {@inhereitdoc} |
|
| 125 | + */ |
|
| 126 | 126 | public function __toString(): string |
| 127 | 127 | { |
| 128 | 128 | return $this->getLocale(); |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
| 132 | - * {@inhereitdoc} |
|
| 133 | - */ |
|
| 132 | + * {@inhereitdoc} |
|
| 133 | + */ |
|
| 134 | 134 | public function getEncoding(): string |
| 135 | 135 | { |
| 136 | 136 | return $this->encoding; |
@@ -177,8 +177,8 @@ discard block |
||
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | /** |
| 180 | - * {@inhereitdoc} |
|
| 181 | - */ |
|
| 180 | + * {@inhereitdoc} |
|
| 181 | + */ |
|
| 182 | 182 | public function tr(string $message, mixed $args = []): string |
| 183 | 183 | { |
| 184 | 184 | $translation = gettext($message); |
@@ -54,8 +54,7 @@ |
||
| 54 | 54 | * @class GettextTranslator |
| 55 | 55 | * @package Platine\Lang\Translator |
| 56 | 56 | */ |
| 57 | -class GettextTranslator extends BaseTranslator |
|
| 58 | -{ |
|
| 57 | +class GettextTranslator extends BaseTranslator { |
|
| 59 | 58 | /** |
| 60 | 59 | * The default domain |
| 61 | 60 | * @var string |
@@ -53,8 +53,7 @@ |
||
| 53 | 53 | * @class TranslatorInterface |
| 54 | 54 | * @package Platine\Lang\Translator |
| 55 | 55 | */ |
| 56 | -interface TranslatorInterface |
|
| 57 | -{ |
|
| 56 | +interface TranslatorInterface { |
|
| 58 | 57 | /** |
| 59 | 58 | * The class constructor |
| 60 | 59 | * @param Configuration|null $config |
@@ -38,6 +38,5 @@ |
||
| 38 | 38 | * @class LocaleNotSupportedException |
| 39 | 39 | * @package Platine\Lang\Exception |
| 40 | 40 | */ |
| 41 | -class LocaleNotSupportedException extends Exception |
|
| 42 | -{ |
|
| 41 | +class LocaleNotSupportedException extends Exception { |
|
| 43 | 42 | } |
@@ -53,8 +53,7 @@ discard block |
||
| 53 | 53 | * @class MemoryStorage |
| 54 | 54 | * @package Platine\Lang\Storage |
| 55 | 55 | */ |
| 56 | -class MemoryStorage implements StorageInterface |
|
| 57 | -{ |
|
| 56 | +class MemoryStorage implements StorageInterface { |
|
| 58 | 57 | /** |
| 59 | 58 | * The configuration instance |
| 60 | 59 | * @var Configuration |
@@ -89,8 +88,7 @@ discard block |
||
| 89 | 88 | * Create new instance |
| 90 | 89 | * @param Configuration|null $config |
| 91 | 90 | */ |
| 92 | - public function __construct(?Configuration $config = null) |
|
| 93 | - { |
|
| 91 | + public function __construct(?Configuration $config = null) { |
|
| 94 | 92 | $this->config = $config ?? new Configuration([]); |
| 95 | 93 | $this->domain = $this->config->get('domain'); |
| 96 | 94 | $this->encoding = $this->config->get('encoding'); |
@@ -50,8 +50,7 @@ |
||
| 50 | 50 | * @class StorageInterface |
| 51 | 51 | * @package Platine\Lang\Storage |
| 52 | 52 | */ |
| 53 | -interface StorageInterface |
|
| 54 | -{ |
|
| 53 | +interface StorageInterface { |
|
| 55 | 54 | /** |
| 56 | 55 | * Set the locale |
| 57 | 56 | * @param string $locale |
@@ -53,8 +53,7 @@ |
||
| 53 | 53 | * @class SessionStorage |
| 54 | 54 | * @package Platine\Lang\Storage |
| 55 | 55 | */ |
| 56 | -class SessionStorage extends MemoryStorage |
|
| 57 | -{ |
|
| 56 | +class SessionStorage extends MemoryStorage { |
|
| 58 | 57 | /** |
| 59 | 58 | * The Session instance |
| 60 | 59 | * @var Session |