Skip to content

Commit

Permalink
Allow nette/utils 4
Browse files Browse the repository at this point in the history
  • Loading branch information
xificurk committed Feb 4, 2023
1 parent 2fe5024 commit 965791b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
],
"require": {
"php": ">=7.4.0 <8.3",
"nette/utils": "^3.2@dev",
"nette/utils": "^3.2@dev || ^4.0@dev",
"nette/forms": "^3.1@dev",
"nette/application": "^3.1.8@dev",
"latte/latte": "^2.9@dev || ^3.0@dev"
Expand Down
12 changes: 12 additions & 0 deletions tests/PHPStan/conditional.config.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php
declare(strict_types = 1);

use Nette\Localization\Translator;

$config = [];

if (version_compare(Latte\Engine::VERSION, '3.0', '<')) {
Expand Down Expand Up @@ -43,4 +45,14 @@
];
}

// Detecting version from composer installed versions does not work, because it gets hijacked by phpstan.phar
$isNetteUtils4 = (new ReflectionMethod(Translator::class, 'translate'))->getParameters()[0]->getType() instanceof ReflectionUnionType;
if ($isNetteUtils4) {
$config['parameters']['ignoreErrors'][] = [
'message' => '~^Parameter \\#1 \\$message of method Nette\\\\Localization\\\\Translator\\:\\:translate\\(\\) expects string\\|Stringable, mixed given\\.$~',
'path' => '../../src/FormRenderer/Filters/SafeTranslateFilter.php',
'count' => 1,
];
}

return $config;

0 comments on commit 965791b

Please sign in to comment.