[CORE][Event] Make all events return \EventResult, enforced at container build time
This commit is contained in:
@@ -32,6 +32,7 @@ use App\Util\Exception\ServerException;
|
||||
use App\Util\Exception\TemporaryFileException;
|
||||
use App\Util\Formatting;
|
||||
use App\Util\TemporaryFile;
|
||||
use EventResult;
|
||||
use Exception;
|
||||
use Jcupitt\Vips;
|
||||
use SplFileInfo;
|
||||
@@ -59,7 +60,7 @@ class ImageEncoder extends Plugin
|
||||
return GSFile::mimetypeMajor($mimetype) === 'image';
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -68,7 +69,7 @@ class ImageEncoder extends Plugin
|
||||
return Event::next;
|
||||
}
|
||||
|
||||
public function onFileSanitizerAvailable(array &$event_map, string $mimetype): bool
|
||||
public function onFileSanitizerAvailable(array &$event_map, string $mimetype): EventResult
|
||||
{
|
||||
if (!self::shouldHandle($mimetype)) {
|
||||
return Event::next;
|
||||
@@ -77,7 +78,7 @@ class ImageEncoder extends Plugin
|
||||
return Event::next;
|
||||
}
|
||||
|
||||
public function onFileResizerAvailable(array &$event_map, string $mimetype): bool
|
||||
public function onFileResizerAvailable(array &$event_map, string $mimetype): EventResult
|
||||
{
|
||||
if (!self::shouldHandle($mimetype)) {
|
||||
return Event::next;
|
||||
@@ -179,7 +180,7 @@ class ImageEncoder extends Plugin
|
||||
/**
|
||||
* Generates the view for attachments of type Image
|
||||
*/
|
||||
public function onViewAttachment(array $vars, array &$res): bool
|
||||
public function onViewAttachment(array $vars, array &$res): EventResult
|
||||
{
|
||||
if (!self::shouldHandle($vars['attachment']->getMimetype())) {
|
||||
return Event::next;
|
||||
@@ -260,7 +261,7 @@ class ImageEncoder extends Plugin
|
||||
*
|
||||
* @return bool true hook value
|
||||
*/
|
||||
public function onPluginVersion(array &$versions): bool
|
||||
public function onPluginVersion(array &$versions): EventResult
|
||||
{
|
||||
$versions[] = [
|
||||
'name' => 'ImageEncoder',
|
||||
|
Reference in New Issue
Block a user