ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
PreProcessor.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26use ILIAS\FileUpload\Processor\PreProcessor as PreProcessorInterface;
27use Closure;
28
29class PreProcessor implements PreProcessorInterface
30{
34 public function __construct(private readonly Closure $fill)
35 {
36 }
37
38 public function process(FileStream $stream, Metadata $metadata): ProcessingStatus
39 {
40 ($this->fill)($stream->getContents());
41
42 return new ProcessingStatus(ProcessingStatus::OK, 'idontcare');
43 }
44}
__construct(private readonly Closure $fill)
process(FileStream $stream, Metadata $metadata)
This method gets invoked by the file upload service to process the file with the help of the processo...
The base interface for all filesystem streams.
Definition: FileStream.php:32