Code Duplication    Length = 8-8 lines in 2 locations

src/Message/MimePart.php 2 locations

@@ 157-164 (lines=8) @@
154
     * @param PartFilter $filter
155
     * @return \ZBateson\MailMimeParser\Message\MimePart
156
     */
157
    public function getPart($index, PartFilter $filter = null)
158
    {
159
        $parts = $this->getAllParts($filter);
160
        if (!isset($parts[$index])) {
161
            return null;
162
        }
163
        return $parts[$index];
164
    }
165
166
    /**
167
     * Returns the current part, all child parts, and child parts of all
@@ 213-220 (lines=8) @@
210
     * @param PartFilter $filter
211
     * @return \ZBateson\MailMimeParser\Message\MimePart
212
     */
213
    public function getChild($index, PartFilter $filter = null)
214
    {
215
        $parts = $this->getChildParts($filter);
216
        if (!isset($parts[$index])) {
217
            return null;
218
        }
219
        return $parts[$index];
220
    }
221
    
222
    /**
223
     * Returns all direct child parts.