Code Duplication    Length = 5-5 lines in 2 locations

Validator.php 2 locations

@@ 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
    }
@@ 430-434 (lines=5) @@
427
    public function setErrors(array $errors, $key = null, $group = null)
428
    {
429
        if (!empty($group)) {
430
            if (!empty($key)) {
431
                $this->errors[$group][$key] = $errors;
432
            } else {
433
                $this->errors[$group] = $errors;
434
            }
435
        } elseif (!empty($key)) {
436
            $this->errors[$key] = $errors;
437
        } else {