Update to Kirby 4.7.0

This commit is contained in:
Paul Nicoué 2025-04-21 18:57:21 +02:00
parent 02a9ab387c
commit ba25a9a198
509 changed files with 26604 additions and 14872 deletions

View file

@ -2,6 +2,7 @@
namespace Kirby\Cms;
use Closure;
use Kirby\Exception\BadMethodCallException;
/**
@ -17,22 +18,17 @@ trait HasMethods
{
/**
* All registered methods
*
* @var array
*/
public static $methods = [];
public static array $methods = [];
/**
* Calls a registered method class with the
* passed arguments
*
* @internal
* @param string $method
* @param array $args
* @return mixed
*
* @throws \Kirby\Exception\BadMethodCallException
*/
public function callMethod(string $method, array $args = [])
public function callMethod(string $method, array $args = []): mixed
{
$closure = $this->getMethod($method);
@ -45,10 +41,7 @@ trait HasMethods
/**
* Checks if the object has a registered method
*
* @internal
* @param string $method
* @return bool
*/
public function hasMethod(string $method): bool
{
@ -59,11 +52,8 @@ trait HasMethods
* Returns a registered method by name, either from
* the current class or from a parent class ordered by
* inheritance order (top to bottom)
*
* @param string $method
* @return \Closure|null
*/
protected function getMethod(string $method)
protected function getMethod(string $method): Closure|null
{
if (isset(static::$methods[$method]) === true) {
return static::$methods[$method];