[CORE][Event] Make all events return \EventResult, enforced at container build time
This commit is contained in:
@@ -42,6 +42,7 @@ use App\Util\Exception\ServerException;
|
||||
use App\Util\Exception\TemporaryFileException;
|
||||
use App\Util\Formatting;
|
||||
use App\Util\TemporaryFile;
|
||||
use EventResult;
|
||||
use Exception;
|
||||
use FFMpeg\FFMpeg as ffmpeg;
|
||||
use FFMpeg\FFProbe as ffprobe;
|
||||
@@ -59,7 +60,7 @@ class VideoEncoder extends Plugin
|
||||
return GSFile::mimetypeMajor($mimetype) === 'video' || $mimetype === 'image/gif';
|
||||
}
|
||||
|
||||
public function onFileMetaAvailable(array &$event_map, string $mimetype): bool
|
||||
public function onFileMetaAvailable(array &$event_map, string $mimetype): EventResult
|
||||
{
|
||||
if (!self::shouldHandle($mimetype)) {
|
||||
return Event::next;
|
||||
@@ -69,7 +70,7 @@ class VideoEncoder extends Plugin
|
||||
return Event::next;
|
||||
}
|
||||
|
||||
public function onFileSanitizerAvailable(array &$event_map, string $mimetype): bool
|
||||
public function onFileSanitizerAvailable(array &$event_map, string $mimetype): EventResult
|
||||
{
|
||||
if ($mimetype !== 'image/gif') {
|
||||
return Event::next;
|
||||
@@ -79,7 +80,7 @@ class VideoEncoder extends Plugin
|
||||
return Event::next;
|
||||
}
|
||||
|
||||
public function onFileResizerAvailable(array &$event_map, string $mimetype): bool
|
||||
public function onFileResizerAvailable(array &$event_map, string $mimetype): EventResult
|
||||
{
|
||||
if ($mimetype !== 'image/gif') {
|
||||
return Event::next;
|
||||
@@ -139,7 +140,7 @@ class VideoEncoder extends Plugin
|
||||
/**
|
||||
* Generates the view for attachments of type Video
|
||||
*/
|
||||
public function onViewAttachment(array $vars, array &$res): bool
|
||||
public function onViewAttachment(array $vars, array &$res): EventResult
|
||||
{
|
||||
if ($vars['attachment']->getMimetypeMajor() !== 'video') {
|
||||
return Event::next;
|
||||
@@ -289,7 +290,7 @@ class VideoEncoder extends Plugin
|
||||
/**
|
||||
* @throws ServerException
|
||||
*/
|
||||
public function onPluginVersion(array &$versions): bool
|
||||
public function onPluginVersion(array &$versions): EventResult
|
||||
{
|
||||
$versions[] = ['name' => 'FFmpeg',
|
||||
'version' => self::version(),
|
||||
|
Reference in New Issue
Block a user