@@ -64,11 +64,11 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function __construct($adapterName, $xgettextBin) |
| 66 | 66 | { |
| 67 | - $this->basePath = realpath(__DIR__ . '/..'); |
|
| 67 | + $this->basePath = realpath(__DIR__.'/..'); |
|
| 68 | 68 | |
| 69 | 69 | //init files |
| 70 | - $this->logPath = $this->basePath . '/po_parser.log'; |
|
| 71 | - $this->resultPath = sys_get_temp_dir() . '/poedit_' . $adapterName . '_' . md5(microtime()) . '.php'; |
|
| 70 | + $this->logPath = $this->basePath.'/po_parser.log'; |
|
| 71 | + $this->resultPath = sys_get_temp_dir().'/poedit_'.$adapterName.'_'.md5(microtime()).'.php'; |
|
| 72 | 72 | |
| 73 | 73 | $this->setXgettextBin($xgettextBin); |
| 74 | 74 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | throw new \Exception('Invalid adapterName supplied'); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - $targetClassName = '\\GettextParser\\Adapter\\' . $adapterName; |
|
| 108 | + $targetClassName = '\\GettextParser\\Adapter\\'.$adapterName; |
|
| 109 | 109 | |
| 110 | 110 | if (class_exists($targetClassName)) { |
| 111 | 111 | $this->adapter = new $targetClassName; |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | $this->phrasesList = array_merge($this->phrasesList, $phrases); |
| 177 | 177 | } |
| 178 | 178 | } else { |
| 179 | - $this->log("Cannot read file {$filePath}" . PHP_EOL); |
|
| 179 | + $this->log("Cannot read file {$filePath}".PHP_EOL); |
|
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | } |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | $this->writePhrase($phrase); |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | - return (bool) file_put_contents($this->resultPath, $this->writeBuffer, FILE_BINARY); |
|
| 197 | + return ( bool )file_put_contents($this->resultPath, $this->writeBuffer, FILE_BINARY); |
|
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | /** |
@@ -202,9 +202,9 @@ discard block |
||
| 202 | 202 | */ |
| 203 | 203 | protected function writeHeader() |
| 204 | 204 | { |
| 205 | - $this->writeBuffer = "<?php" . PHP_EOL . "/*" . PHP_EOL; |
|
| 205 | + $this->writeBuffer = "<?php".PHP_EOL."/*".PHP_EOL; |
|
| 206 | 206 | $this->writeBuffer .= implode(PHP_EOL, $this->filesList); |
| 207 | - $this->writeBuffer .= PHP_EOL . "*/"; |
|
| 207 | + $this->writeBuffer .= PHP_EOL."*/"; |
|
| 208 | 208 | $this->writeBuffer .= str_repeat(PHP_EOL, 2); |
| 209 | 209 | } |
| 210 | 210 | |
@@ -220,12 +220,12 @@ discard block |
||
| 220 | 220 | if ($idx > 0) { |
| 221 | 221 | $this->writeBuffer .= ', '; |
| 222 | 222 | } |
| 223 | - $this->writeBuffer .= '"' . $item . '"'; |
|
| 223 | + $this->writeBuffer .= '"'.$item.'"'; |
|
| 224 | 224 | } |
| 225 | - $this->writeBuffer .= ', 3);' . PHP_EOL; |
|
| 225 | + $this->writeBuffer .= ', 3);'.PHP_EOL; |
|
| 226 | 226 | } else { |
| 227 | 227 | //single |
| 228 | - $this->writeBuffer .= '_("' . $phrase . '");' . PHP_EOL; |
|
| 228 | + $this->writeBuffer .= '_("'.$phrase.'");'.PHP_EOL; |
|
| 229 | 229 | } |
| 230 | 230 | } |
| 231 | 231 | |
@@ -236,8 +236,8 @@ discard block |
||
| 236 | 236 | { |
| 237 | 237 | chdir($this->xgettextDir); |
| 238 | 238 | |
| 239 | - $cmd = $this->xgettextBin . ' --force-po -o "' . $params[2] . '" ' . $params[3] . ' ' . $params[4] . ' "' |
|
| 240 | - . $this->resultPath . '"'; |
|
| 239 | + $cmd = $this->xgettextBin.' --force-po -o "'.$params[2].'" '.$params[3].' '.$params[4].' "' |
|
| 240 | + . $this->resultPath.'"'; |
|
| 241 | 241 | |
| 242 | 242 | $this->log($cmd); |
| 243 | 243 | |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | protected function log($message) |
| 255 | 255 | { |
| 256 | 256 | $f = fopen($this->logPath, 'a'); |
| 257 | - fwrite($f, $message . PHP_EOL); |
|
| 257 | + fwrite($f, $message.PHP_EOL); |
|
| 258 | 258 | fclose($f); |
| 259 | 259 | } |
| 260 | 260 | |