CounterVisitor extends PHPSubscriptionCheck { public int getFunctionNumber() { return functionCounter; } CounterVisitor(Tree tree); @Override List<Kind> nodesToVisit(); @Override void visitNode(Tree tree); int getFunctionNumber(); int getStatementNumber(); int getClassNumber();  }
@Test public void test_functions() throws Exception { CounterVisitor counterVisitor = new CounterVisitor(parse("metrics/functions.php")); assertThat(counterVisitor.getFunctionNumber()).isEqualTo(4); }