@@ -20,7 +20,8 @@ |
||
| 20 | 20 | |
| 21 | 21 | public function filter($in, $out, &$consumed, $closing): int |
| 22 | 22 | { |
| 23 | - while ($bucket = stream_bucket_make_writeable($in)) { |
|
| 23 | + while ($bucket = stream_bucket_make_writeable($in)) |
|
| 24 | + { |
|
| 24 | 25 | self::$output .= $bucket->data; |
| 25 | 26 | $consumed += $bucket->datalen; |
| 26 | 27 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | |
| 22 | 22 | private readonly FilesystemPath $folder; |
| 23 | 23 | |
| 24 | - public function __construct(string|FilesystemPath $folderPath) |
|
| 24 | + public function __construct(string | FilesystemPath $folderPath) |
|
| 25 | 25 | { |
| 26 | 26 | $this->frozen = false; |
| 27 | 27 | $this->folder = new FilesystemPath($folderPath); |
@@ -26,7 +26,8 @@ discard block |
||
| 26 | 26 | $this->frozen = false; |
| 27 | 27 | $this->folder = new FilesystemPath($folderPath); |
| 28 | 28 | |
| 29 | - if (!$this->folder->isDir()) { |
|
| 29 | + if (!$this->folder->isDir()) |
|
| 30 | + { |
|
| 30 | 31 | throw new FileNotFoundException(sprintf('The folder could not be found: %s', $folderPath)); |
| 31 | 32 | } |
| 32 | 33 | } |
@@ -71,11 +72,13 @@ discard block |
||
| 71 | 72 | */ |
| 72 | 73 | public function setTargetDirectory(string $folderName): void |
| 73 | 74 | { |
| 74 | - if ($this->isFrozen()) { |
|
| 75 | + if ($this->isFrozen()) |
|
| 76 | + { |
|
| 75 | 77 | throw new Exception('A frozen folder object cannot be modified.'); |
| 76 | 78 | } |
| 77 | 79 | |
| 78 | - if ($folderName === null || empty($folderName)) { |
|
| 80 | + if ($folderName === null || empty($folderName)) |
|
| 81 | + { |
|
| 79 | 82 | return; |
| 80 | 83 | } |
| 81 | 84 | |
@@ -110,7 +113,8 @@ discard block |
||
| 110 | 113 | $targetFile = $this->folder->generatePath($relativePath); |
| 111 | 114 | $targetFolderPath = (string)$targetFile->getParentDirectory(); |
| 112 | 115 | |
| 113 | - if (!file_exists($targetFolderPath)) { |
|
| 116 | + if (!file_exists($targetFolderPath)) |
|
| 117 | + { |
|
| 114 | 118 | mkdir($targetFolderPath, 0755, true); |
| 115 | 119 | } |
| 116 | 120 | |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | /** |
| 28 | 28 | * {@inheritdoc} |
| 29 | 29 | */ |
| 30 | - public function getParentTemplate(): false|self |
|
| 30 | + public function getParentTemplate(): false | self |
|
| 31 | 31 | { |
| 32 | 32 | $parent = $this->template->getParent([]); |
| 33 | 33 | |
@@ -14,9 +14,12 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | public static function transformData($content): array |
| 16 | 16 | { |
| 17 | - try { |
|
| 17 | + try |
|
| 18 | + { |
|
| 18 | 19 | return json_decode($content, true, 512, JSON_THROW_ON_ERROR); |
| 19 | - } catch (\JsonException) { |
|
| 20 | + } |
|
| 21 | + catch (\JsonException) |
|
| 22 | + { |
|
| 20 | 23 | return []; |
| 21 | 24 | } |
| 22 | 25 | } |