diff --git a/composer.json b/composer.json index 1063131..1558e7a 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ ], "require": { "php": "^7.2 || ^8.0", - "nette/application": "^3.1.4", + "nette/application": "^3.1.5", "nette/utils": "^3.0" }, "require-dev": { diff --git a/src/SecuredLinksControlTrait.php b/src/SecuredLinksControlTrait.php index 24278f5..198afed 100644 --- a/src/SecuredLinksControlTrait.php +++ b/src/SecuredLinksControlTrait.php @@ -17,11 +17,11 @@ trait SecuredLinksControlTrait /** * {@inheritdoc} */ - public function link(string $destination, ...$args): string + public function link(string $destination, $args = []): string { - $args = count($args) === 1 && is_array($args[0] ?? null) - ? $args[0] - : $args; + $args = func_num_args() < 3 && is_array($args) + ? $args + : array_slice(func_get_args(), 1); $link = parent::link($destination, $args); return $this->getPresenter()->createSecuredLink($this, $link, $destination);