@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare (strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Limoncello\l10n\Contracts\Messages; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare (strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Limoncello\l10n\Contracts\Format; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare (strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Limoncello\l10n\Messages; |
| 4 | 4 | |
@@ -101,10 +101,10 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | foreach (scandir($localesDir) as $fileOrDir) { |
| 103 | 103 | if ($fileOrDir !== '.' && $fileOrDir !== '..' && |
| 104 | - is_dir($localeDirFullPath = $localesDir . DIRECTORY_SEPARATOR . $fileOrDir . DIRECTORY_SEPARATOR) |
|
| 104 | + is_dir($localeDirFullPath = $localesDir.DIRECTORY_SEPARATOR.$fileOrDir.DIRECTORY_SEPARATOR) |
|
| 105 | 105 | ) { |
| 106 | 106 | $localeDir = $fileOrDir; |
| 107 | - foreach (glob($localeDirFullPath . $this->getGlobMessagePatterns()) as $messageFile) { |
|
| 107 | + foreach (glob($localeDirFullPath.$this->getGlobMessagePatterns()) as $messageFile) { |
|
| 108 | 108 | $namespace = pathinfo($messageFile, PATHINFO_FILENAME); |
| 109 | 109 | $bundle = $this->loadBundleFromFile($messageFile, $localeDir, $namespace); |
| 110 | 110 | $this->addBundle($bundle); |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare (strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Limoncello\l10n\Messages; |
| 4 | 4 | |
@@ -128,9 +128,9 @@ discard block |
||
| 128 | 128 | // check all keys and values are non-empty strings |
| 129 | 129 | $this->properties = []; |
| 130 | 130 | foreach ($properties as $key => $value) { |
| 131 | - assert(is_scalar($key) === true && strlen((string)$key) > 0); |
|
| 131 | + assert(is_scalar($key) === true && strlen((string) $key) > 0); |
|
| 132 | 132 | assert(is_string($value) === true && strlen($value) > 0); |
| 133 | - $this->properties[(string)$key] = (string)$value; |
|
| 133 | + $this->properties[(string) $key] = (string) $value; |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | return $this; |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare (strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Limoncello\l10n\Contracts\Messages; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare (strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Limoncello\l10n\Contracts\Messages; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare (strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Limoncello\l10n\Messages; |
| 4 | 4 | |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | { |
| 216 | 216 | $isValid = true; |
| 217 | 217 | foreach ($resources as $key => $valueAndLocale) { |
| 218 | - $isValid = $isValid === true && $this->checkPair((string)$key, $valueAndLocale); |
|
| 218 | + $isValid = $isValid === true && $this->checkPair((string) $key, $valueAndLocale); |
|
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | return $isValid; |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare (strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Limoncello\l10n\Messages; |
| 4 | 4 | |
@@ -61,8 +61,7 @@ discard block |
||
| 61 | 61 | foreach ($combinedNamespaces as $namespace) { |
| 62 | 62 | $bundle = $this->getBundle($locale, $namespace); |
| 63 | 63 | $bundle = $bundle !== null ? $bundle : $this->getBundle($defaultLocale, $namespace); |
| 64 | - $data[$locale][$namespace] = $defaultLocale === $locale ? $this->encodeBundle($bundle) : |
|
| 65 | - $this->encodeMergedBundles($bundle, $this->getBundle($defaultLocale, $namespace)); |
|
| 64 | + $data[$locale][$namespace] = $defaultLocale === $locale ? $this->encodeBundle($bundle) : $this->encodeMergedBundles($bundle, $this->getBundle($defaultLocale, $namespace)); |
|
| 66 | 65 | } |
| 67 | 66 | } |
| 68 | 67 | |
@@ -89,7 +88,7 @@ discard block |
||
| 89 | 88 | { |
| 90 | 89 | $encodedBundle = []; |
| 91 | 90 | foreach ($bundle->getKeys() as $key) { |
| 92 | - $encodedBundle[$key] = $this->getBundleValue($bundle, (string)$key); |
|
| 91 | + $encodedBundle[$key] = $this->getBundleValue($bundle, (string) $key); |
|
| 93 | 92 | } |
| 94 | 93 | |
| 95 | 94 | return $encodedBundle; |
@@ -137,13 +136,13 @@ discard block |
||
| 137 | 136 | $encodedBundle = []; |
| 138 | 137 | |
| 139 | 138 | foreach ($commonKeys as $key) { |
| 140 | - $encodedBundle[$key] = $this->getBundleValue($localizedBundle, (string)$key); |
|
| 139 | + $encodedBundle[$key] = $this->getBundleValue($localizedBundle, (string) $key); |
|
| 141 | 140 | } |
| 142 | 141 | foreach ($localizedOnlyKeys as $key) { |
| 143 | - $encodedBundle[$key] = $this->getBundleValue($localizedBundle, (string)$key); |
|
| 142 | + $encodedBundle[$key] = $this->getBundleValue($localizedBundle, (string) $key); |
|
| 144 | 143 | } |
| 145 | 144 | foreach ($defaultOnlyKeys as $key) { |
| 146 | - $encodedBundle[$key] = $this->getBundleValue($defaultBundle, (string)$key); |
|
| 145 | + $encodedBundle[$key] = $this->getBundleValue($defaultBundle, (string) $key); |
|
| 147 | 146 | } |
| 148 | 147 | |
| 149 | 148 | return $encodedBundle; |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare (strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Limoncello\l10n\Format; |
| 4 | 4 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | { |
| 94 | 94 | // underlying `format` method cannot work with arguments that are not convertible to string |
| 95 | 95 | // therefore we have to check that only those that actually can be used |
| 96 | - assert(call_user_func(function () use ($args) : bool { |
|
| 96 | + assert(call_user_func(function() use ($args) : bool { |
|
| 97 | 97 | $result = true; |
| 98 | 98 | foreach ($args as $arg) { |
| 99 | 99 | $result = $result && |