Code Duplication    Length = 11-11 lines in 2 locations

src/Tokens/Element.php 1 location

@@ 157-167 (lines=11) @@
154
    /**
155
     * Required by the ContainsChildren interface.
156
     */
157
    public function removeChild(Token $token)
158
    {
159
        $key = array_search($token, $this->children, true);
160
        if ($key !== false) {
161
            unset($this->children[$key]);
162
163
            return true;
164
        }
165
166
        return false;
167
    }
168
169
    /**
170
     * Getter for 'name'.

src/Tokens/TokenContainer.php 1 location

@@ 64-74 (lines=11) @@
61
    /**
62
     * Required by ContainsChildren interface.
63
     */
64
    public function removeChild(Token $token)
65
    {
66
        $key = array_search($token, $this->children, true);
67
        if ($key !== false) {
68
            unset($this->children[$key]);
69
70
            return true;
71
        }
72
73
        return false;
74
    }
75
76
    /**
77
     * Required by Cleanable interface.