Code Duplication    Length = 7-7 lines in 2 locations

source/Spiral/Validation/Validator.php 2 locations

@@ 345-351 (lines=7) @@
342
            return call_user_func_array($condition, $arguments);
343
        } catch (\Exception $e) {
344
            $condition = func_get_arg(2);
345
            if (is_array($condition)) {
346
                if (is_object($condition[0])) {
347
                    $condition[0] = get_class($condition[0]);
348
                }
349
350
                $condition = join('::', $condition);
351
            }
352
353
            $this->logger()->error(
354
                "Condition '{condition}' failed with '{exception}' while checking '{field}' field.",
@@ 428-434 (lines=7) @@
425
     */
426
    private function addMessage(string $field, string $message, $condition, array $arguments = [])
427
    {
428
        if (is_array($condition)) {
429
            if (is_object($condition[0])) {
430
                $condition[0] = get_class($condition[0]);
431
            }
432
433
            $condition = join('::', $condition);
434
        }
435
436
        $this->errors[$field] = \Spiral\interpolate(
437
            $message,