Code Duplication    Length = 5-5 lines in 2 locations

Validator.php 2 locations

@@ 434-438 (lines=5) @@
431
    public function setErrors(array $errors, $key = null, $group = null)
432
    {
433
        if (!empty($group)) {
434
            if (!empty($key)) {
435
                $this->errors[$group][$key] = $errors;
436
            } else {
437
                $this->errors[$group] = $errors;
438
            }
439
        } elseif (!empty($key)) {
440
            $this->errors[$key] = $errors;
441
        } else {
@@ 222-226 (lines=5) @@
219
     */
220
    public function addError($key, $message, $group = null)
221
    {
222
        if (!empty($group)) {
223
            $this->errors[$group][$key][] = $message;
224
        } else {
225
            $this->errors[$key][] = $message;
226
        }
227
228
        return $this;
229
    }