public static function getReviewTitle(Review $review) { $format = " %s this course"; if ($review->getListId() == UserCourse::LIST_TYPE_CURRENT) { $title = ' is taking this course right now'; } else { $title = sprintf(" <strong>%s</strong> this course", strtolower($review->getProgress())); } $title .= $review->getHours() > 0 ? sprintf(", spending <strong>%s hours</strong> a week on it", $review->getHours()) : ''; $title .= $review->getDifficultyId() ? sprintf(" and found the course difficulty to be <strong>%s</strong>", strtolower($review->getDifficulty())) : ''; $title .= '.'; return $title; }