*/ public function providerValidCodeParse() { return [ 'removePossiblyUnusedMethod' => [ 'foo();', 'foo();', '7.1', ['PossiblyUnusedMethod'], true, ], 'removePossiblyUnusedMethodInMiddle' => [ 'foo(); (new A)->bat();', 'foo(); (new A)->bat();', '7.1', ['PossiblyUnusedMethod'], true, ], 'removeAllPossiblyUnusedMethods' => [ ' [ 'foo(); }', 'foo(); }', '7.1', ['PossiblyUnusedMethod'], true, ], 'dontRemovePossiblyUnusedMethodWithSuppression' => [ 'foo();', 'foo();', '7.1', ['PossiblyUnusedMethod'], true, ], 'removeUnusedMethod' => [ 'foo();', 'foo();', '7.1', ['UnusedMethod'], true, ], 'removeUnusedMethodAtBeginning' => [ 'bar();', 'bar();', '7.1', ['UnusedMethod'], true, ], 'removePossiblyUnusedMethodWithDocblock' => [ 'foo();', 'foo();', '7.1', ['PossiblyUnusedMethod'], true, ], 'removeUnusedMethodWithDocblock' => [ 'foo();', 'foo();', '7.1', ['UnusedMethod'], true, ], 'dontRemovePossiblyUnusedMethodWithVariableCall' => [ '$var(); }', '$var(); }', '7.1', ['PossiblyUnusedMethod'], true, ], 'dontRemovePossiblyUnusedMethodWithVariableCallableCall' => [ ' [ ' [ ' [ '$var(); } foo(new B);', '$var(); } foo(new B);', '7.1', ['PossiblyUnusedMethod'], true, ], 'removePossiblyUnusedMethodWithVariableCall' => [ '$var(); }', '$var(); }', '7.1', ['PossiblyUnusedMethod'], true, ], 'removePossiblyUnusedPropertyWithDocblock' => [ 'foo;', 'foo;', '7.1', ['PossiblyUnusedProperty'], true, ], 'dontRemovePossiblyUnusedPropertyWithMixedUse' => [ 'foo; }', 'foo; }', '7.1', ['PossiblyUnusedProperty'], true, ], 'dontRemovePossiblyUnusedPropertyWithSuppression' => [ ' [ '$var; }', '$var; }', '7.1', ['PossiblyUnusedProperty'], true, ], 'removePossiblyUnusedPropertyWithVariableFetch' => [ '$var; }', '$var; }', '7.1', ['PossiblyUnusedProperty'], true, ], 'dontRemovePossiblyUnusedPropertyWithVariableFetchInParent' => [ '$k = $v; } } class B extends A { public $foo = "hello"; } (new B())->__set("foo", "bar");', '$k = $v; } } class B extends A { public $foo = "hello"; } (new B())->__set("foo", "bar");', '7.1', ['PossiblyUnusedProperty'], true, ], 'dontRemovePossiblyUnusedPropertyWithVariableOnParent' => [ '$var; } foo(new A(), "foo");', '$var; } foo(new A(), "foo");', '7.1', ['PossiblyUnusedProperty'], true, ], 'dontRemovePossiblyUnusedPropertyWithVariableFetchImplementedInterface' => [ '$var; } foo(new A(), "foo");', '$var; } foo(new A(), "foo");', '7.1', ['PossiblyUnusedProperty'], true, ], 'dontRemovePossiblyUnusedPropertyWithStaticVariableFetch' => [ ' [ '$var = "hello"; }', '$var = "hello"; }', '7.1', ['PossiblyUnusedProperty'], true, ], 'dontRemovePossiblyUnusedPropertyWithVariableAssignmentOnParent' => [ '$var = "hello"; } foo(new B);', '$var = "hello"; } foo(new B);', '7.1', ['PossiblyUnusedProperty'], true, ], 'dontRemovePossiblyUnusedPropertyWithStaticVariableAssignment' => [ ' [ 'foo;', 'foo;', '7.1', ['UnusedProperty'], true, ], ]; } }