Add ArrayFilterEvent, replace app_menu hook

This commit is contained in:
Art4 2025-01-28 15:24:49 +00:00 committed by Hypolite Petovan
parent 5b28b3d28f
commit 715248d6a2
5 changed files with 158 additions and 8 deletions

View file

@ -0,0 +1,39 @@
<?php
// Copyright (C) 2010-2024, the Friendica project
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
//
// SPDX-License-Identifier: AGPL-3.0-or-later
declare(strict_types=1);
namespace Friendica\Event;
/**
* Allow Event listener to modify an array.
*
* @internal
*/
final class ArrayFilterEvent extends Event
{
public const APP_MENU = 'friendica.data.app_menu';
private array $array;
public function __construct(string $name, array $array)
{
parent::__construct($name);
$this->array = $array;
}
public function getArray(): array
{
return $this->array;
}
public function setArray(array $array): void
{
$this->array = $array;
}
}