Code Duplication    Length = 17-17 lines in 2 locations

include/html2text/html2text.php 2 locations

@@ 73-89 (lines=17) @@
70
 *
71
 * @return null|string
72
 */
73
function next_child_name($node)
74
{
75
    // get the next child
76
    $nextNode = $node->nextSibling;
77
    while (null !== $nextNode) {
78
        if ($nextNode instanceof DOMElement) {
79
            break;
80
        }
81
        $nextNode = $nextNode->nextSibling;
82
    }
83
    $nextName = null;
84
    if ($nextNode instanceof DOMElement && null !== $nextNode) {
85
        $nextName = mb_strtolower($nextNode->nodeName);
86
    }
87
88
    return $nextName;
89
}
90
91
/**
92
 * @param $node
@@ 96-112 (lines=17) @@
93
 *
94
 * @return null|string
95
 */
96
function prev_child_name($node)
97
{
98
    // get the previous child
99
    $nextNode = $node->previousSibling;
100
    while (null !== $nextNode) {
101
        if ($nextNode instanceof DOMElement) {
102
            break;
103
        }
104
        $nextNode = $nextNode->previousSibling;
105
    }
106
    $nextName = null;
107
    if ($nextNode instanceof DOMElement && null !== $nextNode) {
108
        $nextName = mb_strtolower($nextNode->nodeName);
109
    }
110
111
    return $nextName;
112
}
113
114
/**
115
 * @param DOMNode $node