Code Duplication    Length = 8-8 lines in 11 locations

src/Capsule/Collection.php 11 locations

@@ 42-49 (lines=8) @@
39
    /**
40
     * {@inheritdoc}
41
     */
42
    public function aggregate(array $pipeline, array $options = [])
43
    {
44
        $query = $this->prepareQuery(__FUNCTION__, null, $pipeline, $options);
45
        $result = parent::aggregate($query->getData(), $query->getOptions());
46
        $this->notifyQueryExecution($query);
47
48
        return $result;
49
    }
50
51
    /**
52
     * {@inheritdoc}
@@ 54-61 (lines=8) @@
51
    /**
52
     * {@inheritdoc}
53
     */
54
    public function count($filter = [], array $options = [])
55
    {
56
        $query = $this->prepareQuery(__FUNCTION__, $filter, null, $options);
57
        $result = parent::count($query->getFilters(), $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 find($filter = [], array $options = [])
67
    {
68
        $query = $this->prepareQuery(__FUNCTION__, $filter, null, $options);
69
        $result = parent::find($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 findOne($filter = [], array $options = [])
79
    {
80
        $query = $this->prepareQuery(__FUNCTION__, $filter, null, $options);
81
        $result = parent::findOne($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 findOneAndUpdate($filter, $update, array $options = [])
91
    {
92
        $query = $this->prepareQuery(__FUNCTION__, $filter, $update, $options);
93
        $result = parent::findOneAndUpdate($query->getFilters(), $query->getData(), $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 findOneAndDelete($filter, array $options = [])
103
    {
104
        $query = $this->prepareQuery(__FUNCTION__, $filter, null, $options);
105
        $result = parent::findOneAndDelete($query->getFilters(), $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 deleteMany($filter, array $options = [])
115
    {
116
        $query = $this->prepareQuery(__FUNCTION__, $filter, null, $options);
117
        $result = parent::deleteMany($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 deleteOne($filter, array $options = [])
127
    {
128
        $query = $this->prepareQuery(__FUNCTION__, $filter, null, $options);
129
        $result = parent::deleteOne($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 replaceOne($filter, $replacement, array $options = [])
139
    {
140
        $query = $this->prepareQuery(__FUNCTION__, $filter, $replacement, $options);
141
        $result = parent::replaceOne($query->getFilters(), $query->getData(), $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 insertOne($document, array $options = [])
151
    {
152
        $query = $this->prepareQuery(__FUNCTION__, [], $document, $options);
153
        $result = parent::insertOne($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 updateOne($filter, $update, array $options = [])
163
    {
164
        $query = $this->prepareQuery(__FUNCTION__, $filter, $update, $options);
165
        $result = parent::updateOne($query->getFilters(), $query->getData(), $query->getOptions());
166
        $this->notifyQueryExecution($query);
167
168
        return $result;
169
    }
170
171
    /**
172
     * @param string $method