@@ -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 | /** |
| 57 | 56 | * Set the locale |
@@ -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 | } |
@@ -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 | /** |
| 59 | 58 | * The translator instance |
@@ -65,8 +64,7 @@ discard block |
||
| 65 | 64 | * Create new instance |
| 66 | 65 | * @param TranslatorInterface $translator |
| 67 | 66 | */ |
| 68 | - public function __construct(TranslatorInterface $translator) |
|
| 69 | - { |
|
| 67 | + public function __construct(TranslatorInterface $translator) { |
|
| 70 | 68 | $this->translator = $translator; |
| 71 | 69 | } |
| 72 | 70 | |
@@ -212,8 +212,8 @@ discard block |
||
| 212 | 212 | */ |
| 213 | 213 | public function tr(string $message, $args = []): string |
| 214 | 214 | { |
| 215 | - if (!empty($args) && !is_array($args)) { |
|
| 216 | - $args = array_slice(func_get_args(), 1); |
|
| 215 | + if (!empty($args) && !is_array($args)) { |
|
| 216 | + $args = array_slice(func_get_args(), 1); |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | return $this->translator->tr($message, $args); |
@@ -234,8 +234,8 @@ discard block |
||
| 234 | 234 | int $count, |
| 235 | 235 | $args = [] |
| 236 | 236 | ): string { |
| 237 | - if (!empty($args) && !is_array($args)) { |
|
| 238 | - $args = array_slice(func_get_args(), 1); |
|
| 237 | + if (!empty($args) && !is_array($args)) { |
|
| 238 | + $args = array_slice(func_get_args(), 1); |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | return $this->translator->trp( |
@@ -122,16 +122,16 @@ discard block |
||
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
| 125 | - * {@inhereitdoc} |
|
| 126 | - */ |
|
| 125 | + * {@inhereitdoc} |
|
| 126 | + */ |
|
| 127 | 127 | public function __toString(): string |
| 128 | 128 | { |
| 129 | 129 | return $this->getLocale(); |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | /** |
| 133 | - * {@inhereitdoc} |
|
| 134 | - */ |
|
| 133 | + * {@inhereitdoc} |
|
| 134 | + */ |
|
| 135 | 135 | public function getEncoding(): string |
| 136 | 136 | { |
| 137 | 137 | return $this->encoding; |
@@ -178,8 +178,8 @@ discard block |
||
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | /** |
| 181 | - * {@inhereitdoc} |
|
| 182 | - */ |
|
| 181 | + * {@inhereitdoc} |
|
| 182 | + */ |
|
| 183 | 183 | public function tr(string $message, $args = []): string |
| 184 | 184 | { |
| 185 | 185 | $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 | /** |
| 61 | 60 | * The default domain |
@@ -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 | /** |
| 60 | 59 | * The class constructor |
@@ -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 | /** |
| 59 | 58 | * {@inheritdoc} |
@@ -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 | /** |
| 60 | 59 | * The configuration instance |
@@ -90,8 +89,7 @@ discard block |
||
| 90 | 89 | * Create new instance |
| 91 | 90 | * @param Configuration|null $config |
| 92 | 91 | */ |
| 93 | - public function __construct(?Configuration $config = null) |
|
| 94 | - { |
|
| 92 | + public function __construct(?Configuration $config = null) { |
|
| 95 | 93 | $this->config = $config ?? new Configuration([]); |
| 96 | 94 | $this->domain = $this->config->get('domain'); |
| 97 | 95 | $this->encoding = $this->config->get('encoding'); |
@@ -174,7 +174,7 @@ |
||
| 174 | 174 | */ |
| 175 | 175 | public function addDomain(string $domain, ?string $path = null): self |
| 176 | 176 | { |
| 177 | - if ($path === null) { |
|
| 177 | + if ($path === null) { |
|
| 178 | 178 | $path = $this->config->get('translation_path'); |
| 179 | 179 | } |
| 180 | 180 | |
@@ -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 | /** |
| 61 | 60 | * The configuration instance |