From ae2f58b2ede5e672e6b7b2031fafff450dbafccb Mon Sep 17 00:00:00 2001 From: Jakub Kotek Date: Thu, 6 Jan 2022 10:50:55 +0100 Subject: [PATCH] match with nette/application 3.1.5 --- composer.json | 2 +- src/SecuredLinksControlTrait.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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);