@@ -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 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * |
46 | 46 | * @return array<array<int<0, max>, string>|string> |
47 | 47 | */ |
48 | - public function writeRequest(Request $request, ?string $path = '', array|Validator|null $validators = null): array |
|
48 | + public function writeRequest(Request $request, ?string $path = '', array | Validator | null $validators = null): array |
|
49 | 49 | { |
50 | 50 | $uploaded = []; |
51 | 51 | $files = $request->files->all(); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | /** |
78 | 78 | * Write the request's uploaded file to the storage. |
79 | 79 | */ |
80 | - public function writeFile(UploadedFile|File $file, ?string $path = '', ?Validator $validator = null, ?string $filename = null): string |
|
80 | + public function writeFile(UploadedFile | File $file, ?string $path = '', ?Validator $validator = null, ?string $filename = null): string |
|
81 | 81 | { |
82 | 82 | if (!$validator instanceof Validator) { |
83 | 83 | $validator = new Blacklist(); |