Code Duplication    Length = 5-7 lines in 2 locations

Validator.php 2 locations

@@ 312-318 (lines=7) @@
309
     */
310
    public function getFirstError($key, $group = null)
311
    {
312
        if (null !== $group) {
313
            if (isset($this->errors[$group][$key])) {
314
                $first = array_slice($this->errors[$group][$key], 0, 1);
315
316
                return array_shift($first);
317
            }
318
        }
319
320
        if (isset($this->errors[$key])) {
321
            $first = array_slice($this->errors[$key], 0, 1);
@@ 320-324 (lines=5) @@
317
            }
318
        }
319
320
        if (isset($this->errors[$key])) {
321
            $first = array_slice($this->errors[$key], 0, 1);
322
323
            return array_shift($first);
324
        }
325
326
        return '';
327
    }