test_class.file: php-checks/src/test/java/org/sonar/php/checks/utils/type/ArrayAccessTest.java
test_class.identifier: ArrayAccessTest
test_case.body: @Test
    public void test() {
      CompilationUnitTree unit = (CompilationUnitTree) TreeValuesTest.PARSER.parse("<?php " +
      /* expr0 */ "$x[0];" +
      /* expr1 */ "$y;" +
      /* expr2 */ "foreach ($arr as $value) { }" +
      /* expr3 */ "foreach ($arr as $key => $value) { }");
      SymbolTable symbolTable = SymbolTableImpl.create(unit);
      TreeValues expr0 = TreeValues.of(expression(unit, 0), symbolTable);
      TreeValues expr1 = TreeValues.of(expression(unit, 1), symbolTable);
      ForEachStatementTree expr2 = (ForEachStatementTree) unit.script().statements().get(2);
      ForEachStatementTree expr3 = (ForEachStatementTree) unit.script().statements().get(3);
  
      TreeValues expr2value = TreeValues.of(expr2.value(), symbolTable);
      TreeValues expr2expression = TreeValues.of(expr2.expression(), symbolTable);
      TreeValues expr3value = TreeValues.of(expr3.value(), symbolTable);
  
      assertThat(new ArrayAccess(values -> true).test(expr0)).isTrue();
      assertThat(new ArrayAccess(values -> false).test(expr0)).isFalse();
      assertThat(new ArrayAccess(values -> true).test(expr1)).isFalse();
      assertThat(new ArrayAccess(values -> true).test(expr2value)).isTrue();
      assertThat(new ArrayAccess(values -> true).test(expr2expression)).isFalse();
      assertThat(new ArrayAccess(values -> values.values.get(0) == expr2.expression()).test(expr2value)).isTrue();
      assertThat(new ArrayAccess(values -> values.values.get(0) == expr3.expression()).test(expr2value)).isFalse();
      assertThat(new ArrayAccess(values -> values.values.get(0) == expr3.expression()).test(expr3value)).isTrue();
    }
test_case.class_method_signature: ArrayAccessTest.test()
test_case.full_signature: @Test public void test()
test_case.identifier: test
test_case.invocations: parse create of expression of expression get statements script get statements script of value of expression of value isTrue assertThat test isFalse assertThat test isFalse assertThat test isTrue assertThat test isFalse assertThat test isTrue assertThat test get expression isFalse assertThat test get expression isTrue assertThat test get expression
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test()
focal_class.declarator: nestedPredicates
focal_class.modifier: private final
focal_class.original_string: private final TypePredicateList nestedPredicates;
focal_class.type: TypePredicateList
focal_class.var_name: nestedPredicates
focal_class.file: php-checks/src/main/java/org/sonar/php/checks/utils/type/ArrayAccess.java
focal_class.identifier: ArrayAccess
focal_class.interfaces: implements Predicate<TreeValues>
focal_class.class_method_signature: ArrayAccess.ArrayAccess(Predicate<TreeValues>... nestedPredicates)
focal_class.full_signature: public  ArrayAccess(Predicate<TreeValues>... nestedPredicates)
focal_class.identifier: ArrayAccess
focal_class.modifiers: public
focal_class.parameters: (Predicate<TreeValues>... nestedPredicates)
focal_class.signature:  ArrayAccess(Predicate<TreeValues>... nestedPredicates)
focal_class.class_method_signature: ArrayAccess.test(TreeValues possibleValues)
focal_class.full_signature: @Override public boolean test(TreeValues possibleValues)
focal_class.identifier: test
focal_class.modifiers: @Override public
focal_class.parameters: (TreeValues possibleValues)
focal_class.return: boolean
focal_class.signature: boolean test(TreeValues possibleValues)
focal_class.class_method_signature: ArrayAccess.matches(TreeValues possibleValues, ArrayAccessTree arrayAccess)
focal_class.full_signature: protected boolean matches(TreeValues possibleValues, ArrayAccessTree arrayAccess)
focal_class.identifier: matches
focal_class.modifiers: protected
focal_class.parameters: (TreeValues possibleValues, ArrayAccessTree arrayAccess)
focal_class.return: boolean
focal_class.signature: boolean matches(TreeValues possibleValues, ArrayAccessTree arrayAccess)
focal_class.class_method_signature: ArrayAccess.matches(TreeValues possibleValues, ExpressionTree value, ForEachStatementTree forEachStatementTree)
focal_class.full_signature: protected boolean matches(TreeValues possibleValues, ExpressionTree value, ForEachStatementTree forEachStatementTree)
focal_class.identifier: matches
focal_class.modifiers: protected
focal_class.parameters: (TreeValues possibleValues, ExpressionTree value, ForEachStatementTree forEachStatementTree)
focal_class.return: boolean
focal_class.signature: boolean matches(TreeValues possibleValues, ExpressionTree value, ForEachStatementTree forEachStatementTree)
focal_method.body: @Override
    public boolean test(TreeValues possibleValues) {
      for (ExpressionTree tree : possibleValues.values) {
        if ((tree.is(Tree.Kind.ARRAY_ACCESS) && matches(possibleValues, (ArrayAccessTree) tree)) ||
          (tree.getParent().is(Tree.Kind.FOREACH_STATEMENT) && matches(possibleValues, tree, (ForEachStatementTree) tree.getParent()))) {
          return true;
        }
      }
      return false;
    }
focal_method.class_method_signature: ArrayAccess.test(TreeValues possibleValues)
focal_method.full_signature: @Override public boolean test(TreeValues possibleValues)
focal_method.identifier: test
focal_method.invocations: is matches is getParent matches getParent
focal_method.modifiers: @Override public
focal_method.parameters: (TreeValues possibleValues)
focal_method.return: boolean
focal_method.signature: boolean test(TreeValues possibleValues)