[ 'input' => 'i = $i; } public function getPlus5() { return $this->i + 5; } }', 'output' => 'i = $i; } public function getPlus5() { return $this->i + 5; } }', 'php_version' => '7.4', 'issues_to_fix' => ['MissingImmutableAnnotation'], 'safe_types' => true, ], 'addPureAnnotationToFunctionWithExistingDocblock' => [ 'input' => 'i = $i; } public function getPlus5() { return $this->i + 5; } }', 'output' => 'i = $i; } public function getPlus5() { return $this->i + 5; } }', 'php_version' => '7.4', 'issues_to_fix' => ['MissingImmutableAnnotation'], 'safe_types' => true, ], 'dontAddPureAnnotationWhenMethodHasImpurity' => [ 'input' => 'i = $i; } public function getPlus5() { echo $this->i; return $this->i + 5; } }', 'output' => 'i = $i; } public function getPlus5() { echo $this->i; return $this->i + 5; } }', 'php_version' => '7.4', 'issues_to_fix' => ['MissingImmutableAnnotation'], 'safe_types' => true, ], 'addPureAnnotationWhenClassCanHoldMutableData' => [ 'input' => 'b = $b; } public function getPlus5() { return $this->b->i + 5; } } $b = new B(); $a = new A($b); echo $a->getPlus5(); $b->i = 6; echo $a->getPlus5();', 'output' => 'b = $b; } public function getPlus5() { return $this->b->i + 5; } } $b = new B(); $a = new A($b); echo $a->getPlus5(); $b->i = 6; echo $a->getPlus5();', 'php_version' => '7.4', 'issues_to_fix' => ['MissingImmutableAnnotation'], 'safe_types' => true, ], 'addPureAnnotationToClassThatExtends' => [ 'input' => 'i = $i; } public function mutate() : void { echo "hello"; } } class A extends AParent { public function getPlus5() { return $this->i + 5; } }', 'output' => 'i = $i; } public function mutate() : void { echo "hello"; } } class A extends AParent { public function getPlus5() { return $this->i + 5; } }', 'php_version' => '7.4', 'issues_to_fix' => ['MissingImmutableAnnotation'], 'safe_types' => true, ], ]; } }