Code Duplication    Length = 8-8 lines in 2 locations

src/Internal/CoOption.php 2 locations

@@ 158-165 (lines=8) @@
155
     * @throws InvalidArgumentException
156
     * @return float
157
     */
158
    private static function validateNaturalFloat($key, $value)
159
    {
160
        $value = filter_var($value, FILTER_VALIDATE_FLOAT);
161
        if ($value === false || $value < 0.0) {
162
            throw new \InvalidArgumentException("Option[$key] must be positive float or zero.");
163
        }
164
        return $value;
165
    }
166
167
    /**
168
     * Validate natural int value.
@@ 174-181 (lines=8) @@
171
     * @throws InvalidArgumentException
172
     * @return int
173
     */
174
    private static function validateNaturalInt($key, $value)
175
    {
176
        $value = filter_var($value, FILTER_VALIDATE_INT);
177
        if ($value === false || $value < 0) {
178
            throw new \InvalidArgumentException("Option[$key] must be positive integer or zero.");
179
        }
180
        return $value;
181
    }
182
}
183