*/ public function providerValidCodeParse(): array { return [ 'addPureAnnotationToFunction' => [ 'input' => ' ' '7.4', 'issues_to_fix' => ['MissingPureAnnotation'], 'safe_types' => true, ], 'addPureAnnotationToFunctionWithExistingDocblock' => [ 'input' => ' ' '7.4', 'issues_to_fix' => ['MissingPureAnnotation'], 'safe_types' => true, ], 'dontAddPureAnnotationToImpureFunction' => [ 'input' => ' ' '7.4', 'issues_to_fix' => ['MissingPureAnnotation'], 'safe_types' => true, ], 'dontAddPureAnnotationToMutationFreeMethod' => [ 'input' => 'foo; } }', 'output' => 'foo; } }', 'php_version' => '7.4', 'issues_to_fix' => ['MissingPureAnnotation'], 'safe_types' => true, ], 'dontAddPureAnnotationToFunctionWithImpureCall' => [ 'input' => ' ' '7.4', 'issues_to_fix' => ['MissingPureAnnotation'], 'safe_types' => true, ], 'dontAddPureAnnotationToFunctionWithImpureClosure' => [ 'input' => ' $arr */ function foo(array $arr): array { return array_map($arr, function ($s) { echo $s; return $s;}); }', 'output' => ' $arr */ function foo(array $arr): array { return array_map($arr, function ($s) { echo $s; return $s;}); }', 'php_version' => '7.4', 'issues_to_fix' => ['MissingPureAnnotation'], 'safe_types' => true, ], 'dontAddWhenReferencingThis' => [ 'input' => ' ' '7.4', 'issues_to_fix' => ['MissingPureAnnotation'], 'safe_types' => true, ], 'dontAddInChildMethod' => [ 'input' => 'a; } } class B extends A { public function foo(string $s) : string { return $string; } }', 'output' => 'a; } } class B extends A { public function foo(string $s) : string { return $string; } }', 'php_version' => '7.4', 'issues_to_fix' => ['MissingPureAnnotation'], 'safe_types' => true, ], 'doAddInOtherMethod' => [ 'input' => 'a; } } class B extends A { public function bar(string $s) : string { return $string; } }', 'output' => 'a; } } class B extends A { /** * @psalm-pure */ public function bar(string $s) : string { return $string; } }', 'php_version' => '7.4', 'issues_to_fix' => ['MissingPureAnnotation'], 'safe_types' => true, ], 'dontAddPureIfCallableNotPure' => [ 'input' => ' ' '7.4', 'issues_to_fix' => ['MissingPureAnnotation'], 'safe_types' => true, ], ]; } }