Skip to content

Commit

Permalink
PHP-CS-Fixer#7968 fix phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztof-ciszewski committed May 9, 2024
1 parent f04c854 commit ae5c56f
Showing 1 changed file with 5 additions and 72 deletions.
77 changes: 5 additions & 72 deletions src/Fixer/PhpUnit/PhpUnitDedicateAssertFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,79 +34,9 @@
final class PhpUnitDedicateAssertFixer extends AbstractPhpUnitFixer implements ConfigurableFixerInterface
{
/**
* @var array<string, array{positive: string, negative: false|string, argument_count?: int, swap_arguments?: true}|true>
* @var array|array<string, array{positive: string, negative: false|string, argument_count?: int, swap_arguments?: true}|true>
*/
private array $fixMap = [
'array_key_exists' => [
'positive' => 'assertArrayHasKey',
'negative' => 'assertArrayNotHasKey',
'argument_count' => 2,
],
'empty' => [
'positive' => 'assertEmpty',
'negative' => 'assertNotEmpty',
],
'file_exists' => [
'positive' => 'assertFileExists',
'negative' => 'assertFileNotExists',
],
'is_array' => true,
'is_bool' => true,
'is_callable' => true,
'is_dir' => [
'positive' => 'assertDirectoryExists',
'negative' => 'assertDirectoryNotExists',
],
'is_double' => true,
'is_float' => true,
'is_infinite' => [
'positive' => 'assertInfinite',
'negative' => 'assertFinite',
],
'is_int' => true,
'is_integer' => true,
'is_long' => true,
'is_nan' => [
'positive' => 'assertNan',
'negative' => false,
],
'is_null' => [
'positive' => 'assertNull',
'negative' => 'assertNotNull',
],
'is_numeric' => true,
'is_object' => true,
'is_readable' => [
'positive' => 'assertIsReadable',
'negative' => 'assertNotIsReadable',
],
'is_real' => true,
'is_resource' => true,
'is_scalar' => true,
'is_string' => true,
'is_writable' => [
'positive' => 'assertIsWritable',
'negative' => 'assertNotIsWritable',
],
'str_contains' => [ // since 7.5
'positive' => 'assertStringContainsString',
'negative' => 'assertStringNotContainsString',
'argument_count' => 2,
'swap_arguments' => true,
],
'str_ends_with' => [ // since 3.4
'positive' => 'assertStringEndsWith',
'negative' => 'assertStringEndsNotWith',
'argument_count' => 2,
'swap_arguments' => true,
],
'str_starts_with' => [ // since 3.4
'positive' => 'assertStringStartsWith',
'negative' => 'assertStringStartsNotWith',
'argument_count' => 2,
'swap_arguments' => true,
],
];
private array $fixMap = [];

/**
* @var list<string>
Expand Down Expand Up @@ -656,6 +586,9 @@ private function cloneAndClearTokens(Tokens $tokens, int $start, int $end): arra
return $clone;
}

/**
* @return array|array<string, array{positive: string, negative: false|string, argument_count?: int, swap_arguments?: true}|true>
*/
private function getFixMap(): array
{
return [
Expand Down

0 comments on commit ae5c56f

Please sign in to comment.