@@ -20,29 +20,29 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | class Localization_Writer |
| 22 | 22 | { |
| 23 | - /** |
|
| 24 | - * @var boolean |
|
| 25 | - */ |
|
| 23 | + /** |
|
| 24 | + * @var boolean |
|
| 25 | + */ |
|
| 26 | 26 | private $editable = false; |
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * @var array<string,string> |
|
| 30 | - */ |
|
| 28 | + /** |
|
| 29 | + * @var array<string,string> |
|
| 30 | + */ |
|
| 31 | 31 | private $hashes = array(); |
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * @var Localization_Locale |
|
| 35 | - */ |
|
| 33 | + /** |
|
| 34 | + * @var Localization_Locale |
|
| 35 | + */ |
|
| 36 | 36 | private $locale; |
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * @var string |
|
| 40 | - */ |
|
| 38 | + /** |
|
| 39 | + * @var string |
|
| 40 | + */ |
|
| 41 | 41 | private $fileType; |
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * @var string |
|
| 45 | - */ |
|
| 43 | + /** |
|
| 44 | + * @var string |
|
| 45 | + */ |
|
| 46 | 46 | private $filePath; |
| 47 | 47 | |
| 48 | 48 | public function __construct(Localization_Locale $locale, string $fileType, string $filePath) |
@@ -150,16 +150,16 @@ discard block |
||
| 150 | 150 | return $hashes; |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | - /** |
|
| 154 | - * Sort the strings to ensure they always appear in the same order: |
|
| 155 | - * first by text, and same strings by their hashes. This is important |
|
| 156 | - * for strings that have the same translation to avoid them changing |
|
| 157 | - * order between sorts. |
|
| 158 | - * |
|
| 159 | - * @param array $a |
|
| 160 | - * @param array $b |
|
| 161 | - * @return number |
|
| 162 | - */ |
|
| 153 | + /** |
|
| 154 | + * Sort the strings to ensure they always appear in the same order: |
|
| 155 | + * first by text, and same strings by their hashes. This is important |
|
| 156 | + * for strings that have the same translation to avoid them changing |
|
| 157 | + * order between sorts. |
|
| 158 | + * |
|
| 159 | + * @param array $a |
|
| 160 | + * @param array $b |
|
| 161 | + * @return number |
|
| 162 | + */ |
|
| 163 | 163 | public function callback_sortStrings(array $a, array $b) : int |
| 164 | 164 | { |
| 165 | 165 | $result = strnatcasecmp($a['text'], $b['text']); |
@@ -45,9 +45,9 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | private $targetLocaleName = null; |
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * @var Localization_Source[] |
|
| 50 | - */ |
|
| 48 | + /** |
|
| 49 | + * @var Localization_Source[] |
|
| 50 | + */ |
|
| 51 | 51 | private $sources = array(); |
| 52 | 52 | |
| 53 | 53 | public function addSource(Localization_Source $source) |
@@ -175,14 +175,14 @@ discard block |
||
| 175 | 175 | ); |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | - /** |
|
| 179 | - * Retrieves all available strings for the specified locale, |
|
| 180 | - * as hash => text value pairs. |
|
| 181 | - * |
|
| 182 | - * @param Localization_Locale $locale |
|
| 183 | - * @throws Localization_Exception |
|
| 184 | - * @return string[] |
|
| 185 | - */ |
|
| 178 | + /** |
|
| 179 | + * Retrieves all available strings for the specified locale, |
|
| 180 | + * as hash => text value pairs. |
|
| 181 | + * |
|
| 182 | + * @param Localization_Locale $locale |
|
| 183 | + * @throws Localization_Exception |
|
| 184 | + * @return string[] |
|
| 185 | + */ |
|
| 186 | 186 | public function getStrings(Localization_Locale $locale) |
| 187 | 187 | { |
| 188 | 188 | $this->load($locale); |
@@ -211,14 +211,14 @@ discard block |
||
| 211 | 211 | return !empty($this->strings[$locale->getName()]); |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | - /** |
|
| 215 | - * @param string $type |
|
| 216 | - * @param Localization_Scanner_StringHash[] $hashes |
|
| 217 | - * @param string $file |
|
| 218 | - * @param Localization_Locale $locale |
|
| 219 | - * @param boolean $editable |
|
| 220 | - * @throws Localization_Exception |
|
| 221 | - */ |
|
| 214 | + /** |
|
| 215 | + * @param string $type |
|
| 216 | + * @param Localization_Scanner_StringHash[] $hashes |
|
| 217 | + * @param string $file |
|
| 218 | + * @param Localization_Locale $locale |
|
| 219 | + * @param boolean $editable |
|
| 220 | + * @throws Localization_Exception |
|
| 221 | + */ |
|
| 222 | 222 | protected function renderStringsFile($type, Localization_Source $source, $hashes, $file, Localization_Locale $locale, $editable=true) |
| 223 | 223 | { |
| 224 | 224 | $writer = new Localization_Writer($locale, $type, $file); |
@@ -265,13 +265,13 @@ discard block |
||
| 265 | 265 | ); |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | - /** |
|
| 269 | - * Retrieves the full path to the strings storage ini file |
|
| 270 | - * for the clientside strings. |
|
| 271 | - * |
|
| 272 | - * @param Localization_Locale $locale |
|
| 273 | - * @return string |
|
| 274 | - */ |
|
| 268 | + /** |
|
| 269 | + * Retrieves the full path to the strings storage ini file |
|
| 270 | + * for the clientside strings. |
|
| 271 | + * |
|
| 272 | + * @param Localization_Locale $locale |
|
| 273 | + * @return string |
|
| 274 | + */ |
|
| 275 | 275 | protected function getClientStorageFile(Localization_Locale $locale, Localization_Source $source) |
| 276 | 276 | { |
| 277 | 277 | return sprintf( |
@@ -393,12 +393,12 @@ discard block |
||
| 393 | 393 | return null; |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | - /** |
|
| 397 | - * Retrieves only the strings that are available clientside. |
|
| 398 | - * |
|
| 399 | - * @param Localization_Locale $locale |
|
| 400 | - * @return array |
|
| 401 | - */ |
|
| 396 | + /** |
|
| 397 | + * Retrieves only the strings that are available clientside. |
|
| 398 | + * |
|
| 399 | + * @param Localization_Locale $locale |
|
| 400 | + * @return array |
|
| 401 | + */ |
|
| 402 | 402 | public function getClientStrings(Localization_Locale $locale) |
| 403 | 403 | { |
| 404 | 404 | $result = array(); |