Code Duplication    Length = 5-7 lines in 2 locations

Validator.php 2 locations

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