Lines 100.00% 3 / 3
Methods 100.00% 2 / 2
Classes 100.00% 1 / 1
Name Lines Methods CRAP
 __construct 100.00% 2 / 2 100.00% 1 / 1 2
 validate 100.00% 1 / 1 100.00% 1 / 1 3
9readonly class PopulationFilter extends Filter
10{
11    public function __construct(
12        public int $begin,
13        public int $end,
14    ) {
15        if (!self::validate($begin, $end)) {
16            throw new InvalidArgumentException();
17        }
18    }
19
20    private static function validate(int $begin, int $end): bool
21    {
22        return $begin >= 0 && $end >= 0 && $end >= $begin;
23    }
24}