Просмотр исходного кода

fix: Better array shape in `PhpUnitDedicateAssertFixer` (#7999)

Kuba Werłos 10 месяцев назад
Родитель
Сommit
efe7a396a3
2 измененных файлов с 1 добавлено и 11 удалено
  1. 0 10
      dev-tools/phpstan/baseline.php
  2. 1 1
      src/Fixer/PhpUnit/PhpUnitDedicateAssertFixer.php

+ 0 - 10
dev-tools/phpstan/baseline.php

@@ -566,16 +566,6 @@ $ignoreErrors[] = [
 	'count' => 1,
 	'path' => __DIR__ . '/../../src/Fixer/PhpUnit/PhpUnitDedicateAssertFixer.php',
 ];
-$ignoreErrors[] = [
-	'message' => '#^Only booleans are allowed in an if condition, bool\\|int\\|string given\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/../../src/Fixer/PhpUnit/PhpUnitDedicateAssertFixer.php',
-];
-$ignoreErrors[] = [
-	'message' => '#^Parameter \\#1 \\$token of class PhpCsFixer\\\\Tokenizer\\\\Token constructor expects array\\{int, string\\}\\|string, array\\{[0-9]+, int\\|string\\|true\\} given\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/../../src/Fixer/PhpUnit/PhpUnitDedicateAssertFixer.php',
-];
 $ignoreErrors[] = [
 	'message' => '#^Parameter \\#3 \\$length of function substr expects int\\|null, int\\<0, max\\>\\|false given\\.$#',
 	'count' => 1,

+ 1 - 1
src/Fixer/PhpUnit/PhpUnitDedicateAssertFixer.php

@@ -34,7 +34,7 @@ use PhpCsFixer\Tokenizer\Tokens;
 final class PhpUnitDedicateAssertFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface
 {
     /**
-     * @var array<string, array<string, bool|int|string>|true>
+     * @var array<string, array{positive: string, negative: false|string, argument_count?: int, swap_arguments?: true}|true>
      */
     private static array $fixMap = [
         'array_key_exists' => [