Lines 50.00% 1 / 2
Methods 50.00% 1 / 2
Classes 0.00% 0 / 1
Name Lines Methods CRAP
 __construct 100.00% 1 / 1 100.00% 1 / 1 1
 ratio 0.00% 0 / 1 0.00% 0 / 1 2
7final readonly class Progress implements Instruction
8{
9    /**
10     * @param non-negative-int $done
11     * @param positive-int $total
12     */
13    public function __construct(
14        public int $done,
15        public int $total,
16    ) {}
17
18    public function ratio(): float
19    {
20        return min(1.0, $this->done / $this->total);
21    }
22}