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 7e126ac
Showing 1 changed file with 2 additions and 1 deletion.
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,7 +17,7 @@ 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;

Check failure on line 22 in src/Bridges/AutocompleteInputForms/ExtensionMethodRegistrator.php

View workflow job for this annotation

GitHub Actions / PHP 8.1

Cannot assign offset int|string to Nette\Forms\Container.

Check failure on line 22 in src/Bridges/AutocompleteInputForms/ExtensionMethodRegistrator.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 --prefer-stable

Cannot assign offset int|string to Nette\Forms\Container.

Check failure on line 22 in src/Bridges/AutocompleteInputForms/ExtensionMethodRegistrator.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 --prefer-stable --prefer-lowest

Cannot assign offset int|string to Nette\Forms\Container.

Check failure on line 22 in src/Bridges/AutocompleteInputForms/ExtensionMethodRegistrator.php

View workflow job for this annotation

GitHub Actions / PHP 8.2

Cannot assign offset int|string to Nette\Forms\Container.

Check failure on line 22 in src/Bridges/AutocompleteInputForms/ExtensionMethodRegistrator.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 --prefer-stable

Cannot assign offset int|string to Nette\Forms\Container.

Check failure on line 22 in src/Bridges/AutocompleteInputForms/ExtensionMethodRegistrator.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 --prefer-stable --prefer-lowest

Cannot assign offset int|string to Nette\Forms\Container.

Check failure on line 22 in src/Bridges/AutocompleteInputForms/ExtensionMethodRegistrator.php

View workflow job for this annotation

GitHub Actions / PHP 8.3

Cannot assign offset int|string to Nette\Forms\Container.

Check failure on line 22 in src/Bridges/AutocompleteInputForms/ExtensionMethodRegistrator.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 --prefer-stable

Cannot assign offset int|string to Nette\Forms\Container.

Check failure on line 22 in src/Bridges/AutocompleteInputForms/ExtensionMethodRegistrator.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 --prefer-stable --prefer-lowest

Cannot assign offset int|string to Nette\Forms\Container.

Expand Down

0 comments on commit 7e126ac

Please sign in to comment.