Skip to content

Commit

Permalink
Add missing typehints to closure
Browse files Browse the repository at this point in the history
  • Loading branch information
xificurk committed Feb 2, 2024
1 parent 53228bb commit 2862acd
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Nepada\AutocompleteInput\AutocompleteInput;
use Nette;
use Nette\Forms\Container;
use Nette\Utils\Html;

class ExtensionMethodRegistrator
{
Expand All @@ -16,9 +17,9 @@ public static function register(): void
{
Container::extensionMethod(
'addAutocomplete',
function (Container $container, $name, $label, callable $dataSource, ?int $maxLength = null): AutocompleteInput {
function (Container $container, string|int $name, string|Html|null $label, callable $dataSource, ?int $maxLength = null): AutocompleteInput {
$input = new AutocompleteInput($label, $dataSource, $maxLength);
$container[$name] = $input;
$container[(string) $name] = $input;

return $input;
},
Expand Down

0 comments on commit 2862acd

Please sign in to comment.