Total Complexity | 6 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class RequestHandler |
||
11 | { |
||
12 | public function __construct( |
||
13 | protected ImageSanitize $imageSanitize, |
||
14 | protected MimeTypeList $mimeTypeList, |
||
15 | ) { |
||
16 | } |
||
17 | |||
18 | public function handle(Request $request): void |
||
19 | { |
||
20 | foreach ($this->getMaliciousImages($request->allFiles()) as $file) { |
||
21 | file_put_contents($file->getPathname(), $this->imageSanitize->sanitize($file->get())); |
||
22 | } |
||
23 | } |
||
24 | |||
25 | public function getMaliciousImages(array $files): array |
||
33 | }); |
||
34 | } |
||
35 | |||
36 | public function getImages(array $files): array |
||
40 | }); |
||
41 | } |
||
43 |