test_class.file: php-frontend/src/test/java/org/sonar/php/tree/TreeUtilsTest.java
test_class.identifier: TreeUtilsTest
test_case.body: @Test
    public void test_isDescendant() {
      Tree tree = PHPParserBuilder.createParser().parse("<?= for(;;) {} ?>");
      StatementTree statementTree = ((CompilationUnitTree) tree).script().statements().get(0);
      assertThat(isDescendant(statementTree, tree)).isTrue();
      assertThat(isDescendant(tree, statementTree)).isFalse();
  
      assertThat(isDescendant(tree, tree)).isTrue();
      assertThat(isDescendant(statementTree, statementTree)).isTrue();
  
    }
test_case.class_method_signature: TreeUtilsTest.test_isDescendant()
test_case.full_signature: @Test public void test_isDescendant()
test_case.identifier: test_isDescendant
test_case.invocations: parse createParser get statements script isTrue assertThat isDescendant isFalse assertThat isDescendant isTrue assertThat isDescendant isTrue assertThat isDescendant
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test_isDescendant()
focal_class.file: php-frontend/src/main/java/org/sonar/php/tree/TreeUtils.java
focal_class.identifier: TreeUtils
focal_class.class_method_signature: TreeUtils.TreeUtils()
focal_class.full_signature: private  TreeUtils()
focal_class.identifier: TreeUtils
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  TreeUtils()
focal_class.class_method_signature: TreeUtils.isDescendant(Tree tree, Tree potentialParent)
focal_class.full_signature: public static boolean isDescendant(Tree tree, Tree potentialParent)
focal_class.identifier: isDescendant
focal_class.modifiers: public static
focal_class.parameters: (Tree tree, Tree potentialParent)
focal_class.return: boolean
focal_class.signature: boolean isDescendant(Tree tree, Tree potentialParent)
focal_class.class_method_signature: TreeUtils.findAncestorWithKind(Tree tree, Collection<Tree.Kind> kinds)
focal_class.full_signature: @CheckForNull public static Tree findAncestorWithKind(Tree tree, Collection<Tree.Kind> kinds)
focal_class.identifier: findAncestorWithKind
focal_class.modifiers: @CheckForNull public static
focal_class.parameters: (Tree tree, Collection<Tree.Kind> kinds)
focal_class.return: Tree
focal_class.signature: Tree findAncestorWithKind(Tree tree, Collection<Tree.Kind> kinds)
focal_class.class_method_signature: TreeUtils.descendants(@Nullable Tree root)
focal_class.full_signature: public static Stream<Tree> descendants(@Nullable Tree root)
focal_class.identifier: descendants
focal_class.modifiers: public static
focal_class.parameters: (@Nullable Tree root)
focal_class.return: Stream<Tree>
focal_class.signature: Stream<Tree> descendants(@Nullable Tree root)
focal_class.class_method_signature: TreeUtils.descendants(@Nullable Tree root, Class<T> clazz)
focal_class.full_signature: public static Stream<T> descendants(@Nullable Tree root, Class<T> clazz)
focal_class.identifier: descendants
focal_class.modifiers: public static
focal_class.parameters: (@Nullable Tree root, Class<T> clazz)
focal_class.return: Stream<T>
focal_class.signature: Stream<T> descendants(@Nullable Tree root, Class<T> clazz)
focal_class.class_method_signature: TreeUtils.firstDescendant(@Nullable Tree root, Predicate<Tree> predicate)
focal_class.full_signature: public static Optional<Tree> firstDescendant(@Nullable Tree root, Predicate<Tree> predicate)
focal_class.identifier: firstDescendant
focal_class.modifiers: public static
focal_class.parameters: (@Nullable Tree root, Predicate<Tree> predicate)
focal_class.return: Optional<Tree>
focal_class.signature: Optional<Tree> firstDescendant(@Nullable Tree root, Predicate<Tree> predicate)
focal_class.class_method_signature: TreeUtils.firstDescendant(Tree root, Class<T> clazz)
focal_class.full_signature: public static Optional<T> firstDescendant(Tree root, Class<T> clazz)
focal_class.identifier: firstDescendant
focal_class.modifiers: public static
focal_class.parameters: (Tree root, Class<T> clazz)
focal_class.return: Optional<T>
focal_class.signature: Optional<T> firstDescendant(Tree root, Class<T> clazz)
focal_method.body: public static boolean isDescendant(Tree tree, Tree potentialParent) {
      Tree parent = tree;
      while (parent != null && !potentialParent.equals(parent)) {
        parent = parent.getParent();
      }
      return potentialParent.equals(parent);
    }
focal_method.class_method_signature: TreeUtils.isDescendant(Tree tree, Tree potentialParent)
focal_method.full_signature: public static boolean isDescendant(Tree tree, Tree potentialParent)
focal_method.identifier: isDescendant
focal_method.invocations: equals getParent equals
focal_method.modifiers: public static
focal_method.parameters: (Tree tree, Tree potentialParent)
focal_method.return: boolean
focal_method.signature: boolean isDescendant(Tree tree, Tree potentialParent)