Code Duplication    Length = 10-10 lines in 2 locations

src/Validator/AbstractValidator.php 1 location

@@ 154-163 (lines=10) @@
151
     * @param array $vals
152
     * @return $this
153
     */
154
    public function anyOf(array $vals)
155
    {
156
        $this->add(function ($value, $nameKey) use ($vals) {
157
            if (!in_array($value, $vals)) {
158
                return $this->createError('anyof', $value, $nameKey);
159
            }
160
        });
161
162
        return $this;
163
    }
164
165
    /**
166
>>>>>>> feature/phpcs

src/Validator/Helper/AnyOfTrait.php 1 location

@@ 12-21 (lines=10) @@
9
     * @param array $vals
10
     * @return $this
11
     */
12
    public function anyOf(array $vals)
13
    {
14
        $this->add(function ($value, $nameKey) use ($vals) {
15
            if (!in_array($value, $vals)) {
16
                return $this->createError('anyof', $value, $nameKey);
17
            }
18
        });
19
20
        return $this;
21
    }
22
}
23