<?php

declare(strict_types=1);

namespace App\Scolarite\Domain\Model\Evaluation;

use App\Scolarite\Domain\Exception\CoefficientInvalideException;

final readonly class Coefficient
{
    public function __construct(
        public float $value,
    ) {
        if ($value < 0.1 || $value > 10) {
            throw CoefficientInvalideException::avecValeur($value);
        }
    }

    public function equals(self $other): bool
    {
        return $this->value === $other->value;
    }
}
