@@ -13,7 +13,7 @@ |
||
| 13 | 13 | $autoload = realpath($root.'/../vendor/autoload.php'); |
| 14 | 14 | |
| 15 | 15 | // we need the autoloader to be present |
| 16 | - if(!file_exists($autoload)) { |
|
| 16 | + if (!file_exists($autoload)) { |
|
| 17 | 17 | die('<b>ERROR:</b> Autoloader not present. Run composer update first.'); |
| 18 | 18 | } |
| 19 | 19 | |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | $text = t('This text is in the global scope.'); |
| 4 | 4 | |
| 5 | 5 | $text2 = t( |
| 6 | - 'It is possible to write long texts ' . |
|
| 7 | - 'using text concatenation in the source ' . |
|
| 6 | + 'It is possible to write long texts '. |
|
| 7 | + 'using text concatenation in the source '. |
|
| 8 | 8 | 'code to keep it readable.' |
| 9 | 9 | ); |
| 10 | 10 | \ No newline at end of file |
@@ -49,8 +49,8 @@ |
||
| 49 | 49 | $examples[] = '1.500'; |
| 50 | 50 | |
| 51 | 51 | if ($decimalPositions > 0) { |
| 52 | - $examples[] = '50,' . substr($decimals, 0, $decimalPositions); |
|
| 53 | - $examples[] = '1.500,' . substr($decimals, 0, $decimalPositions); |
|
| 52 | + $examples[] = '50,'.substr($decimals, 0, $decimalPositions); |
|
| 53 | + $examples[] = '1.500,'.substr($decimals, 0, $decimalPositions); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | return $examples; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | public function excludeFolder(string $folder) : Localization_Source_Folder |
| 51 | 51 | { |
| 52 | - if(!in_array($folder, $this->excludes['folders'])) { |
|
| 52 | + if (!in_array($folder, $this->excludes['folders'])) { |
|
| 53 | 53 | $this->excludes['folders'][] = $folder; |
| 54 | 54 | } |
| 55 | 55 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | public function excludeFolders(array $folders) : Localization_Source_Folder |
| 60 | 60 | { |
| 61 | - foreach($folders as $folder) { |
|
| 61 | + foreach ($folders as $folder) { |
|
| 62 | 62 | $this->excludeFolder($folder); |
| 63 | 63 | } |
| 64 | 64 | |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | */ |
| 40 | 40 | public function getArgument(int $index) |
| 41 | 41 | { |
| 42 | - if(isset($this->args[$index])) { |
|
| 42 | + if (isset($this->args[$index])) { |
|
| 43 | 43 | return $this->args[$index]; |
| 44 | 44 | } |
| 45 | 45 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function __construct(string $localeName) |
| 51 | 51 | { |
| 52 | - if(!self::isLocaleKnown($localeName)) |
|
| 52 | + if (!self::isLocaleKnown($localeName)) |
|
| 53 | 53 | { |
| 54 | 54 | throw new Localization_Exception( |
| 55 | 55 | 'Invalid locale', |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | public function getLabel() : string |
| 146 | 146 | { |
| 147 | - switch($this->localeName) |
|
| 147 | + switch ($this->localeName) |
|
| 148 | 148 | { |
| 149 | 149 | case 'de_DE': |
| 150 | 150 | return t('German'); |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | throw new Localization_Exception( |
| 172 | - 'Label is missing for the locale ' . $this->localeName, |
|
| 172 | + 'Label is missing for the locale '.$this->localeName, |
|
| 173 | 173 | null, |
| 174 | 174 | self::ERROR_LOCALE_LABEL_MISSING |
| 175 | 175 | ); |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | */ |
| 182 | 182 | public function getCountry() : Localization_Country |
| 183 | 183 | { |
| 184 | - if(!isset($this->country)) { |
|
| 184 | + if (!isset($this->country)) { |
|
| 185 | 185 | $this->country = Localization::createCountry($this->countryCode); |
| 186 | 186 | } |
| 187 | 187 | |
@@ -9,12 +9,12 @@ |
||
| 9 | 9 | protected function parseDefinition() : void |
| 10 | 10 | { |
| 11 | 11 | // some entries are strings, like parenthesises, semicolons and the like. |
| 12 | - if(is_string($this->definition)) |
|
| 12 | + if (is_string($this->definition)) |
|
| 13 | 13 | { |
| 14 | 14 | $this->token = $this->definition; |
| 15 | 15 | $this->value = null; |
| 16 | 16 | |
| 17 | - if(isset($this->parentToken)) { |
|
| 17 | + if (isset($this->parentToken)) { |
|
| 18 | 18 | $this->line = $this->parentToken->getLine(); |
| 19 | 19 | } |
| 20 | 20 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | $autoload = realpath($root.'/../vendor/autoload.php'); |
| 14 | 14 | |
| 15 | 15 | // we need the autoloader to be present |
| 16 | - if(!file_exists($autoload)) { |
|
| 16 | + if (!file_exists($autoload)) { |
|
| 17 | 17 | die('<b>ERROR:</b> Autoloader not present. Run composer update first.'); |
| 18 | 18 | } |
| 19 | 19 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | public function addHashes(array $hashes) : Localization_Writer |
| 70 | 70 | { |
| 71 | - foreach($hashes as $hash => $text) |
|
| 71 | + foreach ($hashes as $hash => $text) |
|
| 72 | 72 | { |
| 73 | 73 | $this->addHash($hash, $text); |
| 74 | 74 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $hashes = $this->compileHashes(); |
| 91 | 91 | $lines = array(); |
| 92 | 92 | |
| 93 | - foreach($hashes as $entry) |
|
| 93 | + foreach ($hashes as $entry) |
|
| 94 | 94 | { |
| 95 | 95 | $lines[] = sprintf( |
| 96 | 96 | '%s= "%s"', |
@@ -106,16 +106,16 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | private function renderHead() : string |
| 108 | 108 | { |
| 109 | - $title = strtoupper($this->fileType).' TRANSLATION FILE FOR ' . strtoupper($this->locale->getLabel()); |
|
| 109 | + $title = strtoupper($this->fileType).' TRANSLATION FILE FOR '.strtoupper($this->locale->getLabel()); |
|
| 110 | 110 | |
| 111 | 111 | $lines = array(); |
| 112 | 112 | |
| 113 | 113 | $lines[] = '; -------------------------------------------------------'; |
| 114 | - $lines[] = '; '. $title; |
|
| 114 | + $lines[] = '; '.$title; |
|
| 115 | 115 | $lines[] = '; -------------------------------------------------------'; |
| 116 | 116 | $lines[] = '; '; |
| 117 | 117 | |
| 118 | - if($this->editable) |
|
| 118 | + if ($this->editable) |
|
| 119 | 119 | { |
| 120 | 120 | $lines[] = '; You may edit text directly in this file under the following conditions:'; |
| 121 | 121 | $lines[] = '; '; |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | { |
| 138 | 138 | $hashes = array(); |
| 139 | 139 | |
| 140 | - foreach($this->hashes as $hash => $text) |
|
| 140 | + foreach ($this->hashes as $hash => $text) |
|
| 141 | 141 | { |
| 142 | 142 | $hashes[] = array( |
| 143 | 143 | 'hash' => $hash, |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | { |
| 165 | 165 | $result = strnatcasecmp($a['text'], $b['text']); |
| 166 | 166 | |
| 167 | - if($result === 0) |
|
| 167 | + if ($result === 0) |
|
| 168 | 168 | { |
| 169 | 169 | return strnatcmp($a['hash'], $b['hash']); |
| 170 | 170 | } |