@@ -6,10 +6,10 @@ |
||
| 6 | 6 | |
| 7 | 7 | return RectorConfig::configure() |
| 8 | 8 | ->withPaths([ |
| 9 | - __DIR__ . '/src', |
|
| 9 | + __DIR__.'/src', |
|
| 10 | 10 | // __DIR__ . '/tests', |
| 11 | 11 | ]) |
| 12 | 12 | // uncomment to reach your current PHP version |
| 13 | 13 | ->withPhpSets(php83:true) |
| 14 | 14 | ->withAttributesSets() |
| 15 | - ->withPreparedSets(deadCode:true,typeDeclarations:true,codeQuality:true); |
|
| 15 | + ->withPreparedSets(deadCode:true, typeDeclarations:true, codeQuality:true); |
|
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | * @throws \Scrawler\Exception\FileValidationException |
| 56 | 56 | */ |
| 57 | 57 | #[\Override] |
| 58 | - public function validate(UploadedFile|File $file): void |
|
| 58 | + public function validate(UploadedFile | File $file): void |
|
| 59 | 59 | { |
| 60 | 60 | if ([] !== $this->allowedMimeTypes && !\in_array($file->getMimeType(), $this->allowedMimeTypes, true)) { |
| 61 | 61 | throw new \Scrawler\Exception\FileValidationException('Invalid file type.'); |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | * @throws \Scrawler\Exception\FileValidationException |
| 88 | 88 | */ |
| 89 | 89 | #[\Override] |
| 90 | - public function validate(UploadedFile|File $file): void |
|
| 90 | + public function validate(UploadedFile | File $file): void |
|
| 91 | 91 | { |
| 92 | 92 | if (\in_array($file->getMimeType(), $this->blockedMimeTypes)) { |
| 93 | 93 | throw new \Scrawler\Exception\FileValidationException('Invalid file type.'); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | * @throws \Scrawler\Exception\FileValidationException |
| 67 | 67 | */ |
| 68 | 68 | #[\Override] |
| 69 | - public function validate(UploadedFile|File $file): void |
|
| 69 | + public function validate(UploadedFile | File $file): void |
|
| 70 | 70 | { |
| 71 | 71 | if (!in_array($file->getMimeType(), $this->allowedMimeTypes)) { |
| 72 | 72 | throw new \Scrawler\Exception\FileValidationException('Invalid file type.'); |
@@ -83,14 +83,14 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | #[\Override] |
| 86 | - public function getProcessedContent(UploadedFile|File $file): string |
|
| 86 | + public function getProcessedContent(UploadedFile | File $file): string |
|
| 87 | 87 | { |
| 88 | 88 | $file = $this->processImage($file); |
| 89 | 89 | |
| 90 | 90 | return $file->getContent(); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - private function mimeScan(UploadedFile|File $file): void |
|
| 93 | + private function mimeScan(UploadedFile | File $file): void |
|
| 94 | 94 | { |
| 95 | 95 | // Mime-type assignment |
| 96 | 96 | if (in_array($file->getMimeType(), $this->mimes('png'))) { |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - private function binaryScan(UploadedFile|File $file): void |
|
| 105 | + private function binaryScan(UploadedFile | File $file): void |
|
| 106 | 106 | { |
| 107 | 107 | $readfile = $file->getContent(); |
| 108 | 108 | $chunk = strtolower(bin2hex($readfile)); |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | // @codeCoverageIgnoreEnd |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | - private function processImage(UploadedFile|File $file): UploadedFile|File |
|
| 139 | + private function processImage(UploadedFile | File $file): UploadedFile | File |
|
| 140 | 140 | { |
| 141 | 141 | $normalize = $this->mimes('normalize'); |
| 142 | 142 | |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | /* |
| 21 | 21 | * Get processed file content. |
| 22 | 22 | */ |
| 23 | - public function getProcessedContent(UploadedFile|File $file): string |
|
| 23 | + public function getProcessedContent(UploadedFile | File $file): string |
|
| 24 | 24 | { |
| 25 | 25 | return $file->getContent(); |
| 26 | 26 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * |
| 36 | 36 | * @throws \Scrawler\Exception\FileValidationException |
| 37 | 37 | */ |
| 38 | - public function runValidate(UploadedFile|File $file): void |
|
| 38 | + public function runValidate(UploadedFile | File $file): void |
|
| 39 | 39 | { |
| 40 | 40 | // @codeCoverageIgnoreStart |
| 41 | 41 | if ($file instanceof UploadedFile) { |
@@ -64,5 +64,5 @@ discard block |
||
| 64 | 64 | * |
| 65 | 65 | * @throws \Scrawler\Exception\FileValidationException |
| 66 | 66 | */ |
| 67 | - abstract public function validate(UploadedFile|File $file): void; |
|
| 67 | + abstract public function validate(UploadedFile | File $file): void; |
|
| 68 | 68 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | * |
| 39 | 39 | * @return array<array<int<0, max>, string>|string> |
| 40 | 40 | */ |
| 41 | - public function writeRequest(Request $request, string $path = '', array|Validator|null $validators = null, array $options = []): array |
|
| 41 | + public function writeRequest(Request $request, string $path = '', array | Validator | null $validators = null, array $options = []): array |
|
| 42 | 42 | { |
| 43 | 43 | $uploaded = []; |
| 44 | 44 | $files = $request->files->all(); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * |
| 73 | 73 | * @param array<string,mixed> $options |
| 74 | 74 | */ |
| 75 | - public function writeFile(UploadedFile|File $file, string $path = '', ?Validator $validator = null, array $options = []): string |
|
| 75 | + public function writeFile(UploadedFile | File $file, string $path = '', ?Validator $validator = null, array $options = []): string |
|
| 76 | 76 | { |
| 77 | 77 | if (!$validator instanceof Validator) { |
| 78 | 78 | $validator = new Blacklist(); |