Code Duplication    Length = 10-10 lines in 2 locations

src/Valdi/Validator/Collection.php 1 location

@@ 60-69 (lines=10) @@
57
    /**
58
     * {@inheritdoc}
59
     */
60
    public function isValid($value, array $parameters) {
61
        if (count($parameters) !== 2) {
62
            throw new ValidationException('"collection" expects two parameters.');
63
        }
64
        if (!($parameters[0] instanceof Validator)) {
65
            throw new ValidationException('"collection" expects the first parameter to be an instance of a Validator.');
66
        }
67
        return in_array($value, ['', null], true) ||
68
            $this->isValidCollection($value, $parameters[0], $parameters[1]);
69
    }
70
71
    /**
72
     * {@inheritdoc}

src/Valdi/Validator/Nested.php 1 location

@@ 58-67 (lines=10) @@
55
    /**
56
     * {@inheritdoc}
57
     */
58
    public function isValid($value, array $parameters) {
59
        if (count($parameters) !== 2) {
60
            throw new ValidationException('"nested" expects two parameters.');
61
        }
62
        if (!($parameters[0] instanceof Validator)) {
63
            throw new ValidationException('"nested" expects the first parameter to be an instance of a Validator.');
64
        }
65
        return in_array($value, ['', null], true) ||
66
            $this->isValidNested($value, $parameters[0], $parameters[1]);
67
    }
68
69
    /**
70
     * {@inheritdoc}