apply() public method

This method checks that all private class properties are at least accessed by one method.
public apply ( PHPMD\AbstractNode $node ) : void
$node PHPMD\AbstractNode
return void
Example #1
0
 /**
  * testRuleDoesNotApplyToPrivateStringIndexFieldAccess
  *
  * <code>
  * class Foo {
  *     private $bar = "Manuel";
  *     // ...
  *     public function baz() {
  *         return $this->bar{3};
  *     }
  * }
  * </code>
  *
  * @return void
  */
 public function testRuleDoesNotApplyToPrivateStringIndexFieldAccess()
 {
     $rule = new UnusedPrivateField();
     $rule->setReport($this->getReportMock(0));
     $rule->apply($this->getClass());
 }