Code Duplication    Length = 8-8 lines in 2 locations

lib/Mongo/MongoWriteBatch.php 2 locations

@@ 168-175 (lines=8) @@
165
    private function validate(array $item)
166
    {
167
        switch ($this->batchType) {
168
            case self::COMMAND_UPDATE:
169
                if (! isset($item['q'])) {
170
                    throw new Exception("Expected \$item to contain 'q' key");
171
                }
172
                if (! isset($item['u'])) {
173
                    throw new Exception("Expected \$item to contain 'u' key");
174
                }
175
                break;
176
177
            case self::COMMAND_DELETE:
178
                if (! isset($item['q'])) {
@@ 177-184 (lines=8) @@
174
                }
175
                break;
176
177
            case self::COMMAND_DELETE:
178
                if (! isset($item['q'])) {
179
                    throw new Exception("Expected \$item to contain 'q' key");
180
                }
181
                if (! isset($item['limit'])) {
182
                    throw new Exception("Expected \$item to contain 'limit' key");
183
                }
184
                break;
185
        }
186
    }
187