src/Entity/AbstractRatingEntity.php
protected function checkRatingValue($rating, $throwException = true)
    {
        if (!is_int($rating) || static::RATING_EXCELLENT < $rating || static::RATING_NONE > $rating) {
            if ($throwException) {
                throw new \InvalidArgumentException(sprintf('%s is not a valid rating value.', $rating));
            }
            return false;
        }
        return true;
    }
protected function checkRatingValue($rating, $throwException = true)
    {
        if (!is_int($rating) || static::RATING_EXCELLENT < $rating || static::RATING_NONE > $rating) {
            if ($throwException) {
                throw new \InvalidArgumentException(sprintf('%s is not a valid rating value.', $rating));
            }
            return false;
        }
        return true;
    }
Checks if rating is a valid value.

@param int $rating
@param bool $throwException
@throws \InvalidArgumentException
@return bool