@@ -297,6 +297,9 @@ |
||
| 297 | 297 | return $logDirectory; |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | + /** |
|
| 301 | + * @param string $string |
|
| 302 | + */ |
|
| 300 | 303 | private function convertToUtf8($string): string |
| 301 | 304 | { |
| 302 | 305 | if (! \mb_detect_encoding($string, 'UTF-8', true)) { |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Paraunit\Parser\JSON; |
| 5 | 5 | |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | */ |
| 241 | 241 | private function writeArray($buffer) |
| 242 | 242 | { |
| 243 | - array_walk_recursive($buffer, function (&$input) { |
|
| 243 | + array_walk_recursive($buffer, function(&$input) { |
|
| 244 | 244 | if (is_string($input)) { |
| 245 | 245 | $input = $this->convertToUtf8($input); |
| 246 | 246 | } |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | private function getLogFilename(): string |
| 267 | 267 | { |
| 268 | 268 | $logDir = $this->getLogDirectory(); |
| 269 | - if (! @mkdir($logDir, 0777, true) && ! is_dir($logDir)) { |
|
| 269 | + if ( ! @mkdir($logDir, 0777, true) && ! is_dir($logDir)) { |
|
| 270 | 270 | throw new \RuntimeException('Cannot create folder for JSON logs'); |
| 271 | 271 | } |
| 272 | 272 | |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | |
| 300 | 300 | private function convertToUtf8($string): string |
| 301 | 301 | { |
| 302 | - if (! \mb_detect_encoding($string, 'UTF-8', true)) { |
|
| 302 | + if ( ! \mb_detect_encoding($string, 'UTF-8', true)) { |
|
| 303 | 303 | return \mb_convert_encoding($string, 'UTF-8'); |
| 304 | 304 | } |
| 305 | 305 | |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Paraunit\Printer; |
| 5 | 5 | |