This commit is contained in:
2023-12-12 15:35:36 +08:00
parent f22a2a70b6
commit 7f5c4127e1
+4 -3
View File
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Kiri\Events;
use Closure;
use Psr\EventDispatcher\ListenerProviderInterface;
use SplPriorityQueue;
@@ -35,11 +36,11 @@ class EventProvider implements ListenerProviderInterface
/**
* @param string $event
* @param array|\Closure|string $handler
* @param array|Closure|string $handler
* @param int $zOrder
* @throws \Exception
* @throws
*/
public function on(string $event, array|\Closure|string $handler, int $zOrder = 1)
public function on(string $event, array|Closure|string $handler, int $zOrder = 1): void
{
if (is_string($handler) && !is_callable($handler, true)) {
throw new \Exception('Event handler must is execute function.');