Code Duplication    Length = 8-8 lines in 2 locations

lib/Mongo/MongoWriteBatch.php 2 locations

@@ 211-218 (lines=8) @@
208
    private function validate(array $item)
209
    {
210
        switch ($this->batchType) {
211
            case self::COMMAND_UPDATE:
212
                if (! isset($item['q'])) {
213
                    throw new Exception("Expected \$item to contain 'q' key");
214
                }
215
                if (! isset($item['u'])) {
216
                    throw new Exception("Expected \$item to contain 'u' key");
217
                }
218
                break;
219
220
            case self::COMMAND_DELETE:
221
                if (! isset($item['q'])) {
@@ 220-227 (lines=8) @@
217
                }
218
                break;
219
220
            case self::COMMAND_DELETE:
221
                if (! isset($item['q'])) {
222
                    throw new Exception("Expected \$item to contain 'q' key");
223
                }
224
                if (! isset($item['limit'])) {
225
                    throw new Exception("Expected \$item to contain 'limit' key");
226
                }
227
                break;
228
        }
229
    }
230