From 514ceb6010f4098c688f059c4eab466dc99a71dc Mon Sep 17 00:00:00 2001 From: Hadi Akbarzadeh Date: Tue, 20 May 2025 17:56:36 +0330 Subject: [PATCH] Add setDefaultHandler method --- src/ShortcodeFacade.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ShortcodeFacade.php b/src/ShortcodeFacade.php index 32cf1ce..f747f0d 100644 --- a/src/ShortcodeFacade.php +++ b/src/ShortcodeFacade.php @@ -111,6 +111,19 @@ public function setParser(ParserInterface $parser) return $this; } + /** + * @param callable $handler + * @psalm-param callable(ShortcodeInterface):string $handler + * + * @return $this + */ + public function setDefaultHandler($handler) + { + $this->handlers->setDefault($handler); + + return $this; + } + /** * @param string $name * @psalm-param callable(ShortcodeInterface):string $handler