*/ public function providerValidCodeParse() { return [ 'addPureAnnotationToFunction' => [ 'i = $i; } public function getPlus5() { return $this->i + 5; } }', 'i = $i; } public function getPlus5() { return $this->i + 5; } }', '7.4', ['MissingImmutableAnnotation'], true, ], 'addPureAnnotationToFunctionWithExistingDocblock' => [ 'i = $i; } public function getPlus5() { return $this->i + 5; } }', 'i = $i; } public function getPlus5() { return $this->i + 5; } }', '7.4', ['MissingImmutableAnnotation'], true, ], 'dontAddPureAnnotationWhenMethodHasImpurity' => [ 'i = $i; } public function getPlus5() { echo $this->i; return $this->i + 5; } }', 'i = $i; } public function getPlus5() { echo $this->i; return $this->i + 5; } }', '7.4', ['MissingImmutableAnnotation'], true, ], 'dontAddPureAnnotationWhenClassCanHoldMutableData' => [ '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();', '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();', '7.4', ['MissingImmutableAnnotation'], true, ], ]; } }