| @@ -64,8 +64,9 @@ discard block | ||
| 64 | 64 | } | 
| 65 | 65 | } | 
| 66 | 66 | |
| 67 | - if(empty($ret)) | |
| 68 | - $ret = self::parseHTTPHeader(); | |
| 67 | +        if(empty($ret)) { | |
| 68 | + $ret = self::parseHTTPHeader(); | |
| 69 | + } | |
| 69 | 70 | |
| 70 | 71 | $ret = array_unique($ret); | 
| 71 | 72 | // Sort the detected languages by quality, with the highest quality first | 
| @@ -155,8 +156,9 @@ discard block | ||
| 155 | 156 | |
| 156 | 157 |          if ($outdated) { | 
| 157 | 158 | $config = $this->load($this->langFilePath); | 
| 158 | - if ($this->mergeFallback) | |
| 159 | - $config = array_replace_recursive($this->load($this->getConfigFilename($this->fallbackLang)), $config); | |
| 159 | +            if ($this->mergeFallback) { | |
| 160 | + $config = array_replace_recursive($this->load($this->getConfigFilename($this->fallbackLang)), $config); | |
| 161 | + } | |
| 160 | 162 | |
| 161 | 163 |              $compiled = "<?php class " . $this->prefix . " {\n" | 
| 162 | 164 | . $this->compile($config) | 
| @@ -165,16 +167,16 @@ discard block | ||
| 165 | 167 | . "\n}\n}\n" | 
| 166 | 168 | . $this->compileFunction(); | 
| 167 | 169 | |
| 168 | - if( ! is_dir($this->cachePath)) | |
| 169 | - mkdir($this->cachePath, 0755, true); | |
| 170 | +			if( ! is_dir($this->cachePath)) { | |
| 171 | + mkdir($this->cachePath, 0755, true); | |
| 172 | + } | |
| 170 | 173 | |
| 171 | 174 |              if (file_put_contents($this->cacheFilePath, $compiled) === FALSE) { | 
| 172 | 175 |                  throw new \Exception("Could not write cache file to path '" . $this->cacheFilePath . "'. Is it writable?"); | 
| 173 | 176 | } | 
| 174 | 177 |              try{ | 
| 175 | 178 | chmod($this->cacheFilePath, 0755); | 
| 176 | - } | |
| 177 | -              catch(\Throwable $t){ | |
| 179 | +              } catch(\Throwable $t){ | |
| 178 | 180 |                  throw new \Exception("Could chmod cache file '" . $this->cacheFilePath . "'"); | 
| 179 | 181 | } | 
| 180 | 182 | |
| @@ -197,8 +199,9 @@ discard block | ||
| 197 | 199 | |
| 198 | 200 | public function l($message, $context = []): string | 
| 199 | 201 |      { | 
| 200 | - foreach($context as $i => $context_message) | |
| 201 | - $context[$i] = $this->l($context_message); | |
| 202 | +        foreach($context as $i => $context_message) { | |
| 203 | + $context[$i] = $this->l($context_message); | |
| 204 | + } | |
| 202 | 205 | |
| 203 | 206 | return call_user_func($this->prefix, $message, $context); | 
| 204 | 207 | } |