Skip to content

Commit

Permalink
Merge pull request #34 from natocTo/JakubK-CompatibilityWithNetteAppl…
Browse files Browse the repository at this point in the history
…ication3.1.5

Sync SecuredLinksControlTrait::link() with nette/application 3.1.5+
  • Loading branch information
hrach authored Jan 24, 2022
2 parents d4618db + ae2f58b commit 6e11dd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
8 changes: 4 additions & 4 deletions src/SecuredLinksControlTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6e11dd0

Please sign in to comment.