Code Duplication    Length = 19-23 lines in 3 locations

thirdparty/html5lib/HTML5/TreeBuilder.php 3 locations

@@ 1512-1534 (lines=23) @@
1509
                case 'center': case 'datagrid': case 'details': case 'dir':
1510
                case 'div': case 'dl': case 'fieldset': case 'footer':
1511
                case 'header': case 'hgroup': case 'listing': case 'menu':
1512
                case 'nav': case 'ol': case 'pre': case 'section': case 'ul':
1513
                    /* If the stack of open elements has an element in scope
1514
                    with the same tag name as that of the token, then generate
1515
                    implied end tags. */
1516
                    if($this->elementInScope($token['name'])) {
1517
                        $this->generateImpliedEndTags();
1518
1519
                        /* Now, if the current node is not an element with
1520
                        the same tag name as that of the token, then this
1521
                        is a parse error. */
1522
                        // XERROR: implement parse error logic
1523
1524
                        /* If the stack of open elements has an element in
1525
                        scope with the same tag name as that of the token,
1526
                        then pop elements from this stack until an element
1527
                        with that tag name has been popped from the stack. */
1528
                        do {
1529
                            $node = array_pop($this->stack);
1530
                        } while ($node->tagName !== $token['name']);
1531
                    } else {
1532
                        // parse error
1533
                    }
1534
                break;
1535
1536
                /* An end tag whose tag name is "form" */
1537
                case 'form':
@@ 1591-1611 (lines=21) @@
1588
                break;
1589
1590
                /* An end tag whose tag name is "li" */
1591
                case 'li':
1592
                    /* If the stack of open elements does not have an element
1593
                     * in list item scope with the same tag name as that of the
1594
                     * token, then this is a parse error; ignore the token. */
1595
                    if ($this->elementInScope($token['name'], self::SCOPE_LISTITEM)) {
1596
                        /* Generate implied end tags, except for elements with the
1597
                         * same tag name as the token. */
1598
                        $this->generateImpliedEndTags(array($token['name']));
1599
                        /* If the current node is not an element with the same tag
1600
                         * name as that of the token, then this is a parse error. */
1601
                        // XERROR: parse error
1602
                        /* Pop elements from the stack of open elements  until an
1603
                         * element with the same tag name as the token has been
1604
                         * popped from the stack. */
1605
                        do {
1606
                            $node = array_pop($this->stack);
1607
                        } while ($node->tagName !== $token['name']);
1608
                    } else {
1609
                        // XERROR: parse error
1610
                    }
1611
                break;
1612
1613
                /* An end tag whose tag name is "dc", "dd", "ds", "dt" */
1614
                case 'dc': case 'dd': case 'ds': case 'dt':
@@ 1614-1632 (lines=19) @@
1611
                break;
1612
1613
                /* An end tag whose tag name is "dc", "dd", "ds", "dt" */
1614
                case 'dc': case 'dd': case 'ds': case 'dt':
1615
                    if($this->elementInScope($token['name'])) {
1616
                        $this->generateImpliedEndTags(array($token['name']));
1617
1618
                        /* If the current node is not an element with the same
1619
                        tag name as the token, then this is a parse error. */
1620
                        // XERROR: implement parse error
1621
1622
                        /* Pop elements from the stack of open elements  until
1623
                         * an element with the same tag name as the token has
1624
                         * been popped from the stack. */
1625
                        do {
1626
                            $node = array_pop($this->stack);
1627
                        } while ($node->tagName !== $token['name']);
1628
1629
                    } else {
1630
                        // XERROR: parse error
1631
                    }
1632
                break;
1633
1634
                /* An end tag whose tag name is one of: "h1", "h2", "h3", "h4",
1635
                "h5", "h6" */