Code Duplication    Length = 11-11 lines in 2 locations

src/Infrastructure/Model/Repository/EloquentMongoDB/EloquentWriteRepository.php 2 locations

@@ 18-28 (lines=11) @@
15
     *
16
     * @return int
17
     */
18
    public function count(Filter $filter = null)
19
    {
20
        $model = self::$instance;
21
        $query = $model->query();
22
23
        if ($filter) {
24
            EloquentFilter::filter($query, $filter);
25
        }
26
27
        return (int) $query->getQuery()->count();
28
    }
29
30
    /**
31
     * Returns whether an entity with the given id exists.
@@ 107-117 (lines=11) @@
104
     *
105
     * @return bool
106
     */
107
    public function removeAll(Filter $filter = null)
108
    {
109
        $model = self::$instance;
110
        $query = $model->query();
111
112
        if ($filter) {
113
            EloquentFilter::filter($query, $filter);
114
        }
115
116
        return $query->delete();
117
    }
118
119
    /**
120
     * Repository data is added or removed as a whole block.