Answer the question
In order to leave comments, you need to log in
Create new ValueObject when comparing or use int values?
Some function that compares values.
public function equalToRatingOrHigher(int $rating) : bool
{
return $this->rating >= $rating;
}
// или так правильно
public function equalToRatingOrHigher(UserRating $rating) : bool
{
return $this->rating >= $rating->rating();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question