Code Duplication    Length = 8-8 lines in 12 locations

src/Capsule/Collection.php 12 locations

@@ 54-61 (lines=8) @@
51
    /**
52
     * {@inheritdoc}
53
     */
54
    public function aggregate(array $pipeline, array $options = [])
55
    {
56
        $query = $this->prepareQuery(__FUNCTION__, null, $pipeline, $options);
57
        $result = parent::aggregate($query->getData(), $query->getOptions());
58
        $this->notifyQueryExecution($query);
59
60
        return $result;
61
    }
62
63
    /**
64
     * {@inheritdoc}
@@ 66-73 (lines=8) @@
63
    /**
64
     * {@inheritdoc}
65
     */
66
    public function count($filter = [], array $options = [])
67
    {
68
        $query = $this->prepareQuery(__FUNCTION__, $filter, null, $options);
69
        $result = parent::count($query->getFilters(), $query->getOptions());
70
        $this->notifyQueryExecution($query);
71
72
        return $result;
73
    }
74
75
    /**
76
     * {@inheritdoc}
@@ 78-85 (lines=8) @@
75
    /**
76
     * {@inheritdoc}
77
     */
78
    public function find($filter = [], array $options = [])
79
    {
80
        $query = $this->prepareQuery(__FUNCTION__, $filter, null, $options);
81
        $result = parent::find($query->getFilters(), $query->getOptions());
82
        $this->notifyQueryExecution($query);
83
84
        return $result;
85
    }
86
87
    /**
88
     * {@inheritdoc}
@@ 90-97 (lines=8) @@
87
    /**
88
     * {@inheritdoc}
89
     */
90
    public function findOne($filter = [], array $options = [])
91
    {
92
        $query = $this->prepareQuery(__FUNCTION__, $filter, null, $options);
93
        $result = parent::findOne($query->getFilters(), $query->getOptions());
94
        $this->notifyQueryExecution($query);
95
96
        return $result;
97
    }
98
99
    /**
100
     * {@inheritdoc}
@@ 102-109 (lines=8) @@
99
    /**
100
     * {@inheritdoc}
101
     */
102
    public function findOneAndUpdate($filter, $update, array $options = [])
103
    {
104
        $query = $this->prepareQuery(__FUNCTION__, $filter, $update, $options);
105
        $result = parent::findOneAndUpdate($query->getFilters(), $query->getData(), $query->getOptions());
106
        $this->notifyQueryExecution($query);
107
108
        return $result;
109
    }
110
111
    /**
112
     * {@inheritdoc}
@@ 114-121 (lines=8) @@
111
    /**
112
     * {@inheritdoc}
113
     */
114
    public function findOneAndDelete($filter, array $options = [])
115
    {
116
        $query = $this->prepareQuery(__FUNCTION__, $filter, null, $options);
117
        $result = parent::findOneAndDelete($query->getFilters(), $query->getOptions());
118
        $this->notifyQueryExecution($query);
119
120
        return $result;
121
    }
122
123
    /**
124
     * {@inheritdoc}
@@ 126-133 (lines=8) @@
123
    /**
124
     * {@inheritdoc}
125
     */
126
    public function deleteMany($filter, array $options = [])
127
    {
128
        $query = $this->prepareQuery(__FUNCTION__, $filter, null, $options);
129
        $result = parent::deleteMany($query->getFilters(), $query->getOptions());
130
        $this->notifyQueryExecution($query);
131
132
        return $result;
133
    }
134
135
    /**
136
     * {@inheritdoc}
@@ 138-145 (lines=8) @@
135
    /**
136
     * {@inheritdoc}
137
     */
138
    public function deleteOne($filter, array $options = [])
139
    {
140
        $query = $this->prepareQuery(__FUNCTION__, $filter, null, $options);
141
        $result = parent::deleteOne($query->getFilters(), $query->getOptions());
142
        $this->notifyQueryExecution($query);
143
144
        return $result;
145
    }
146
147
    /**
148
     * {@inheritdoc}
@@ 150-157 (lines=8) @@
147
    /**
148
     * {@inheritdoc}
149
     */
150
    public function replaceOne($filter, $replacement, array $options = [])
151
    {
152
        $query = $this->prepareQuery(__FUNCTION__, $filter, $replacement, $options);
153
        $result = parent::replaceOne($query->getFilters(), $query->getData(), $query->getOptions());
154
        $this->notifyQueryExecution($query);
155
156
        return $result;
157
    }
158
159
    /**
160
     * {@inheritdoc}
@@ 162-169 (lines=8) @@
159
    /**
160
     * {@inheritdoc}
161
     */
162
    public function insertOne($document, array $options = [])
163
    {
164
        $query = $this->prepareQuery(__FUNCTION__, [], $document, $options);
165
        $result = parent::insertOne($query->getData(), $query->getOptions());
166
        $this->notifyQueryExecution($query);
167
168
        return $result;
169
    }
170
171
    /**
172
     * {@inheritdoc}
@@ 174-181 (lines=8) @@
171
    /**
172
     * {@inheritdoc}
173
     */
174
    public function updateOne($filter, $update, array $options = [])
175
    {
176
        $query = $this->prepareQuery(__FUNCTION__, $filter, $update, $options);
177
        $result = parent::updateOne($query->getFilters(), $query->getData(), $query->getOptions());
178
        $this->notifyQueryExecution($query);
179
180
        return $result;
181
    }
182
183
    /**
184
     * {@inheritdoc}
@@ 186-193 (lines=8) @@
183
    /**
184
     * {@inheritdoc}
185
     */
186
    public function distinct($fieldName, $filter = [], array $options = [])
187
    {
188
        $query = $this->prepareQuery(__FUNCTION__, $filter, ['fieldName' => $fieldName], $options);
189
        $result = parent::distinct($fieldName, $query->getFilters(), $query->getOptions());
190
        $this->notifyQueryExecution($query);
191
192
        return $result;
193
    }
194
195
    /**
196
     * @param string        $method