[CORE][Event] Make all events return \EventResult, enforced at container build time

This commit is contained in:
2022-04-03 21:40:32 +01:00
parent aef1fac536
commit d4b7e990ce
60 changed files with 345 additions and 239 deletions

View File

@@ -37,6 +37,7 @@ use Component\Attachment\Entity\AttachmentThumbnail;
use Component\Attachment\Entity\AttachmentToLink;
use Component\Attachment\Entity\AttachmentToNote;
use Component\Link\Entity\Link;
use EventResult;
use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\ServerExceptionInterface;
@@ -95,7 +96,7 @@ class StoreRemoteMedia extends Plugin
* @throws ServerException
* @throws TemporaryFileException
*/
public function onNewLinkFromNote(Link $link, Note $note): bool
public function onNewLinkFromNote(Link $link, Note $note): EventResult
{
// Embed is the plugin to handle these
if ($link->getMimetypeMajor() === 'text') {
@@ -236,7 +237,7 @@ class StoreRemoteMedia extends Plugin
*
* @return bool true hook value
*/
public function onPluginVersion(array &$versions): bool
public function onPluginVersion(array &$versions): EventResult
{
$versions[] = [
'name' => 'StoreRemoteMedia',