From d4618db4cb203d67757bce6713c5a0776a6c3bd1 Mon Sep 17 00:00:00 2001 From: forgie1 Date: Sat, 9 Oct 2021 14:30:29 +0200 Subject: [PATCH] sync with nette/application 3.1.4+ (#31) --- .github/workflows/qa.yaml | 2 +- composer.json | 4 ++-- src/SecuredLinksControlTrait.php | 9 ++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/qa.yaml b/.github/workflows/qa.yaml index 08c6de1..480a0ed 100644 --- a/.github/workflows/qa.yaml +++ b/.github/workflows/qa.yaml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.1', '7.2', '7.3', '7.4', '8.0'] + php: ['7.2', '7.3', '7.4', '8.0'] name: PHP ${{ matrix.php }} diff --git a/composer.json b/composer.json index fc21dca..1063131 100644 --- a/composer.json +++ b/composer.json @@ -11,8 +11,8 @@ } ], "require": { - "php": "^7.1 || ^8.0", - "nette/application": "^3.0.3", + "php": "^7.2 || ^8.0", + "nette/application": "^3.1.4", "nette/utils": "^3.0" }, "require-dev": { diff --git a/src/SecuredLinksControlTrait.php b/src/SecuredLinksControlTrait.php index 219e153..24278f5 100644 --- a/src/SecuredLinksControlTrait.php +++ b/src/SecuredLinksControlTrait.php @@ -17,12 +17,11 @@ trait SecuredLinksControlTrait /** * {@inheritdoc} */ - public function link(string $destination, $args = []): string + public function link(string $destination, ...$args): string { - if (!is_array($args)) { - $args = func_get_args(); - array_shift($args); - } + $args = count($args) === 1 && is_array($args[0] ?? null) + ? $args[0] + : $args; $link = parent::link($destination, $args); return $this->getPresenter()->createSecuredLink($this, $link, $destination);