Code Duplication    Length = 16-16 lines in 2 locations

src/Kunstmaan/MediaBundle/Entity/Folder.php 2 locations

@@ 323-338 (lines=16) @@
320
     *
321
     * @return ArrayCollection
322
     */
323
    public function getMedia($includeDeleted = false)
324
    {
325
        if ($includeDeleted) {
326
            return $this->media;
327
        }
328
329
        return $this->media->filter(
330
            function (Media $entry) {
331
                if ($entry->isDeleted()) {
332
                    return false;
333
                }
334
335
                return true;
336
            }
337
        );
338
    }
339
340
    /**
341
     * @param int $id
@@ 363-378 (lines=16) @@
360
     *
361
     * @return ArrayCollection
362
     */
363
    public function getChildren($includeDeleted = false)
364
    {
365
        if ($includeDeleted) {
366
            return $this->children;
367
        }
368
369
        return $this->children->filter(
370
            function (Folder $entry) {
371
                if ($entry->isDeleted()) {
372
                    return false;
373
                }
374
375
                return true;
376
            }
377
        );
378
    }
379
380
    /**
381
     * @param ArrayCollection $children