[TOOLS] Fix errors pointed out by PHPStan level 4

This commit is contained in:
2022-10-19 22:38:49 +01:00
parent 4d7742e0e1
commit edeee49af9
37 changed files with 168 additions and 198 deletions

View File

@@ -133,8 +133,6 @@ class DeleteNote extends NoteHandlerPlugin
/**
* Adds and connects the _delete_note_action_ route to
* Controller\DeleteNote::class
*
* @return bool Event hook
*/
public function onAddRoute(Router $r): EventResult
{
@@ -152,8 +150,6 @@ class DeleteNote extends NoteHandlerPlugin
* @throws \App\Util\Exception\DuplicateFoundException
* @throws \App\Util\Exception\NotFoundException
* @throws \App\Util\Exception\ServerException
*
* @return bool Event hook
*/
public function onAddExtraNoteActions(Request $request, Note $note, array &$actions): EventResult
{
@@ -193,10 +189,8 @@ class DeleteNote extends NoteHandlerPlugin
* @param \ActivityPhp\Type\AbstractObject $type_activity Activity Streams 2.0 Activity
* @param mixed $type_object Activity's Object
* @param null|\Plugin\ActivityPub\Entity\ActivitypubActivity $ap_act Resulting ActivitypubActivity
*
* @return bool Returns `Event::stop` if handled, `Event::next` otherwise
*/
private function activitypub_handler(Actor $actor, AbstractObject $type_activity, mixed $type_object, ?ActivitypubActivity &$ap_act): bool
private function activitypub_handler(Actor $actor, AbstractObject $type_activity, mixed $type_object, ?ActivitypubActivity &$ap_act): EventResult
{
if ($type_activity->get('type') !== 'Delete'
|| !($type_object instanceof Note)) {
@@ -225,8 +219,6 @@ class DeleteNote extends NoteHandlerPlugin
* @param \ActivityPhp\Type\AbstractObject $type_activity Activity Streams 2.0 Activity
* @param \ActivityPhp\Type\AbstractObject $type_object Activity Streams 2.0 Object
* @param null|\Plugin\ActivityPub\Entity\ActivitypubActivity $ap_act Resulting ActivitypubActivity
*
* @return bool Returns `Event::stop` if handled, `Event::next` otherwise
*/
public function onNewActivityPubActivity(Actor $actor, AbstractObject $type_activity, AbstractObject $type_object, ?ActivitypubActivity &$ap_act): EventResult
{
@@ -240,8 +232,6 @@ class DeleteNote extends NoteHandlerPlugin
* @param \ActivityPhp\Type\AbstractObject $type_activity Activity Streams 2.0 Activity
* @param mixed $type_object Object
* @param null|\Plugin\ActivityPub\Entity\ActivitypubActivity $ap_act Resulting ActivitypubActivity
*
* @return bool Returns `Event::stop` if handled, `Event::next` otherwise
*/
public function onNewActivityPubActivityWithObject(Actor $actor, AbstractObject $type_activity, mixed $type_object, ?ActivitypubActivity &$ap_act): EventResult
{
@@ -253,8 +243,6 @@ class DeleteNote extends NoteHandlerPlugin
*
* @param string $verb GNU social's internal verb
* @param null|string $gs_verb_to_activity_stream_two_verb Resulting Activity Streams 2.0 verb
*
* @return bool Returns `Event::stop` if handled, `Event::next` otherwise
*/
public function onGSVerbToActivityStreamsTwoActivityType(string $verb, ?string &$gs_verb_to_activity_stream_two_verb): EventResult
{