test_class.declarator: parser = PHPParserBuilder.createParser(PHPLexicalGrammar.TOP_STATEMENT)
test_class.modifier: private
test_class.original_string: private ActionParser<Tree> parser = PHPParserBuilder.createParser(PHPLexicalGrammar.TOP_STATEMENT);
test_class.type: ActionParser<Tree>
test_class.var_name: parser
test_class.file: php-checks/src/test/java/org/sonar/php/checks/utils/SyntacticEquivalenceTest.java
test_class.identifier: SyntacticEquivalenceTest
test_case.body: @Test
    public void areSyntacticallyEquivalent() throws Exception {
      assertThat(areSyntacticallyEquivalent(null, null)).isTrue();
      assertThat(areSyntacticallyEquivalent(null, "1;")).isFalse();
      assertThat(areSyntacticallyEquivalent("$x;", null)).isFalse();
      assertThat(areSyntacticallyEquivalent("$x;", "1;")).isFalse();
      assertThat(areSyntacticallyEquivalent("$x;", "$x;")).isTrue();
      assertThat(areSyntacticallyEquivalent("$x;", "$y;")).isFalse();
      assertThat(areSyntacticallyEquivalent("switch ($a) {case 1:}", "switch ($a) {case 1:}")).isTrue();
      assertThat(areSyntacticallyEquivalent("switch ($a) {case 1:}", "switch ($a) {case 1: case2:}")).isFalse();
      assertThat(areSyntacticallyEquivalent("switch ($a) {case 1: case2:}", "switch ($a) {case 1:}")).isFalse();
    }
test_case.class_method_signature: SyntacticEquivalenceTest.areSyntacticallyEquivalent()
test_case.full_signature: @Test public void areSyntacticallyEquivalent()
test_case.identifier: areSyntacticallyEquivalent
test_case.invocations: isTrue assertThat areSyntacticallyEquivalent isFalse assertThat areSyntacticallyEquivalent isFalse assertThat areSyntacticallyEquivalent isFalse assertThat areSyntacticallyEquivalent isTrue assertThat areSyntacticallyEquivalent isFalse assertThat areSyntacticallyEquivalent isTrue assertThat areSyntacticallyEquivalent isFalse assertThat areSyntacticallyEquivalent isFalse assertThat areSyntacticallyEquivalent
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void areSyntacticallyEquivalent()
focal_class.file: php-checks/src/main/java/org/sonar/php/checks/utils/SyntacticEquivalence.java
focal_class.identifier: SyntacticEquivalence
focal_class.class_method_signature: SyntacticEquivalence.SyntacticEquivalence()
focal_class.full_signature: private  SyntacticEquivalence()
focal_class.identifier: SyntacticEquivalence
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  SyntacticEquivalence()
focal_class.class_method_signature: SyntacticEquivalence.areSyntacticallyEquivalent(@Nullable Tree tree1, @Nullable Tree tree2)
focal_class.full_signature: public static boolean areSyntacticallyEquivalent(@Nullable Tree tree1, @Nullable Tree tree2)
focal_class.identifier: areSyntacticallyEquivalent
focal_class.modifiers: public static
focal_class.parameters: (@Nullable Tree tree1, @Nullable Tree tree2)
focal_class.return: boolean
focal_class.signature: boolean areSyntacticallyEquivalent(@Nullable Tree tree1, @Nullable Tree tree2)
focal_class.class_method_signature: SyntacticEquivalence.areSyntacticallyEquivalent(Iterable<? extends Tree> iterable1, Iterable<? extends Tree> iterable2)
focal_class.full_signature: public static boolean areSyntacticallyEquivalent(Iterable<? extends Tree> iterable1, Iterable<? extends Tree> iterable2)
focal_class.identifier: areSyntacticallyEquivalent
focal_class.modifiers: public static
focal_class.parameters: (Iterable<? extends Tree> iterable1, Iterable<? extends Tree> iterable2)
focal_class.return: boolean
focal_class.signature: boolean areSyntacticallyEquivalent(Iterable<? extends Tree> iterable1, Iterable<? extends Tree> iterable2)
focal_class.class_method_signature: SyntacticEquivalence.areSyntacticallyEquivalent(Iterator<? extends Tree> iterator1, Iterator<? extends Tree> iterator2)
focal_class.full_signature: public static boolean areSyntacticallyEquivalent(Iterator<? extends Tree> iterator1, Iterator<? extends Tree> iterator2)
focal_class.identifier: areSyntacticallyEquivalent
focal_class.modifiers: public static
focal_class.parameters: (Iterator<? extends Tree> iterator1, Iterator<? extends Tree> iterator2)
focal_class.return: boolean
focal_class.signature: boolean areSyntacticallyEquivalent(Iterator<? extends Tree> iterator1, Iterator<? extends Tree> iterator2)
focal_method.body: public static boolean areSyntacticallyEquivalent(@Nullable Tree tree1, @Nullable Tree tree2) {
      if (tree1 == tree2) {
        return true;
      }
  
      if (tree1 == null || tree2 == null) {
        return false;
      }
  
      PHPTree phpTree1 = (PHPTree) tree1;
      PHPTree phpTree2 = (PHPTree) tree2;
  
      if (phpTree1.getKind() != phpTree2.getKind()) {
        return false;
      } else if (phpTree1.isLeaf()) {
        return phpTree1.getFirstToken().text().equals(phpTree2.getFirstToken().text());
      }
  
      Iterator<Tree> iterator1 = phpTree1.childrenIterator();
      Iterator<Tree> iterator2 = phpTree2.childrenIterator();
      return areSyntacticallyEquivalent(iterator1, iterator2);
    }
focal_method.class_method_signature: SyntacticEquivalence.areSyntacticallyEquivalent(@Nullable Tree tree1, @Nullable Tree tree2)
focal_method.full_signature: public static boolean areSyntacticallyEquivalent(@Nullable Tree tree1, @Nullable Tree tree2)
focal_method.identifier: areSyntacticallyEquivalent
focal_method.invocations: getKind getKind isLeaf equals text getFirstToken text getFirstToken childrenIterator childrenIterator areSyntacticallyEquivalent
focal_method.modifiers: public static
focal_method.parameters: (@Nullable Tree tree1, @Nullable Tree tree2)
focal_method.return: boolean
focal_method.signature: boolean areSyntacticallyEquivalent(@Nullable Tree tree1, @Nullable Tree tree2)