@@ -1,20 +1,20 @@ |
||
1 | 1 | <?php namespace Limoncello\l10n\Contracts\Messages; |
2 | 2 | |
3 | 3 | /** |
4 | - * Copyright 2015-2016 [email protected] (www.neomerx.com) |
|
5 | - * |
|
6 | - * Licensed under the Apache License, Version 2.0 (the "License"); |
|
7 | - * you may not use this file except in compliance with the License. |
|
8 | - * You may obtain a copy of the License at |
|
9 | - * |
|
10 | - * http://www.apache.org/licenses/LICENSE-2.0 |
|
11 | - * |
|
12 | - * Unless required by applicable law or agreed to in writing, software |
|
13 | - * distributed under the License is distributed on an "AS IS" BASIS, |
|
14 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
15 | - * See the License for the specific language governing permissions and |
|
16 | - * limitations under the License. |
|
17 | - */ |
|
4 | + * Copyright 2015-2016 [email protected] (www.neomerx.com) |
|
5 | + * |
|
6 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
|
7 | + * you may not use this file except in compliance with the License. |
|
8 | + * You may obtain a copy of the License at |
|
9 | + * |
|
10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
|
11 | + * |
|
12 | + * Unless required by applicable law or agreed to in writing, software |
|
13 | + * distributed under the License is distributed on an "AS IS" BASIS, |
|
14 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
15 | + * See the License for the specific language governing permissions and |
|
16 | + * limitations under the License. |
|
17 | + */ |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * @package Limoncello\l10n |
@@ -118,7 +118,7 @@ |
||
118 | 118 | public function setProperties($properties) |
119 | 119 | { |
120 | 120 | // check all keys and values are non-empty strings |
121 | - assert(call_user_func(function () use ($properties) { |
|
121 | + assert(call_user_func(function() use ($properties) { |
|
122 | 122 | foreach ($properties as $key => $value) { |
123 | 123 | if (is_string($key) === false || empty($key) === true || |
124 | 124 | is_string($value) === false || empty($value) === true |
@@ -50,10 +50,10 @@ |
||
50 | 50 | |
51 | 51 | foreach (scandir($localesDir) as $fileOrDir) { |
52 | 52 | if ($fileOrDir !== '.' && $fileOrDir !== '..' && |
53 | - is_dir($localeDirFullPath = $localesDir . DIRECTORY_SEPARATOR . $fileOrDir . DIRECTORY_SEPARATOR) |
|
53 | + is_dir($localeDirFullPath = $localesDir.DIRECTORY_SEPARATOR.$fileOrDir.DIRECTORY_SEPARATOR) |
|
54 | 54 | ) { |
55 | 55 | $localeDir = $fileOrDir; |
56 | - foreach (glob($localeDirFullPath . $this->getGlobMessagePatterns()) as $messageFile) { |
|
56 | + foreach (glob($localeDirFullPath.$this->getGlobMessagePatterns()) as $messageFile) { |
|
57 | 57 | $namespace = pathinfo($messageFile, PATHINFO_FILENAME); |
58 | 58 | $bundle = $this->loadBundleFromFile($messageFile, $localeDir, $namespace); |
59 | 59 | $this->addBundle($bundle); |
@@ -111,7 +111,7 @@ |
||
111 | 111 | { |
112 | 112 | // check storage has 3 levels locale -> namespace -> key & value pairs and |
113 | 113 | // both keys and values are non-empty strings |
114 | - assert(is_array($encodedStorage) === true && call_user_func(function () use ($encodedStorage) { |
|
114 | + assert(is_array($encodedStorage) === true && call_user_func(function() use ($encodedStorage) { |
|
115 | 115 | $isValid = true; |
116 | 116 | foreach ($encodedStorage as $locale => $namespaceResources) { |
117 | 117 | $isValid = $isValid === true && is_string($locale) === true && empty($locale) === false && |
@@ -57,8 +57,7 @@ |
||
57 | 57 | foreach ($combinedNamespaces as $namespace) { |
58 | 58 | $bundle = $this->getBundle($locale, $namespace); |
59 | 59 | $bundle = $bundle !== null ? $bundle : $this->getBundle($defaultLocale, $namespace); |
60 | - $storage[$locale][$namespace] = $defaultLocale === $locale ? $this->encodeBundle($bundle) : |
|
61 | - $this->encodeMergedBundles($bundle, $this->getBundle($defaultLocale, $namespace)); |
|
60 | + $storage[$locale][$namespace] = $defaultLocale === $locale ? $this->encodeBundle($bundle) : $this->encodeMergedBundles($bundle, $this->getBundle($defaultLocale, $namespace)); |
|
62 | 61 | } |
63 | 62 | } |
64 | 63 |
@@ -1,20 +1,20 @@ |
||
1 | 1 | <?php namespace Limoncello\l10n\Contracts\Messages; |
2 | 2 | |
3 | 3 | /** |
4 | - * Copyright 2015-2016 [email protected] (www.neomerx.com) |
|
5 | - * |
|
6 | - * Licensed under the Apache License, Version 2.0 (the "License"); |
|
7 | - * you may not use this file except in compliance with the License. |
|
8 | - * You may obtain a copy of the License at |
|
9 | - * |
|
10 | - * http://www.apache.org/licenses/LICENSE-2.0 |
|
11 | - * |
|
12 | - * Unless required by applicable law or agreed to in writing, software |
|
13 | - * distributed under the License is distributed on an "AS IS" BASIS, |
|
14 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
15 | - * See the License for the specific language governing permissions and |
|
16 | - * limitations under the License. |
|
17 | - */ |
|
4 | + * Copyright 2015-2016 [email protected] (www.neomerx.com) |
|
5 | + * |
|
6 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
|
7 | + * you may not use this file except in compliance with the License. |
|
8 | + * You may obtain a copy of the License at |
|
9 | + * |
|
10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
|
11 | + * |
|
12 | + * Unless required by applicable law or agreed to in writing, software |
|
13 | + * distributed under the License is distributed on an "AS IS" BASIS, |
|
14 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
15 | + * See the License for the specific language governing permissions and |
|
16 | + * limitations under the License. |
|
17 | + */ |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * @package Limoncello\l10n |