*/ public function providerValidCodeParse(): array { return [ 'addPureAnnotationToFunction' => [ ' [ ' [ ' [ 'foo; } }', 'foo; } }', '7.4', ['MissingPureAnnotation'], true, ], 'dontAddPureAnnotationToFunctionWithImpureCall' => [ ' [ ' $arr */ function foo(array $arr): array { return array_map($arr, function ($s) { echo $s; return $s;}); }', ' $arr */ function foo(array $arr): array { return array_map($arr, function ($s) { echo $s; return $s;}); }', '7.4', ['MissingPureAnnotation'], true, ], 'dontAddWhenReferencingThis' => [ ' [ 'a; } } class B extends A { public function foo(string $s) : string { return $string; } }', 'a; } } class B extends A { public function foo(string $s) : string { return $string; } }', '7.4', ['MissingPureAnnotation'], true, ], 'doAddInOtherMethod' => [ 'a; } } class B extends A { public function bar(string $s) : string { return $string; } }', 'a; } } class B extends A { /** * @psalm-pure */ public function bar(string $s) : string { return $string; } }', '7.4', ['MissingPureAnnotation'], true, ], ]; } }