<?php

use Joomla\CMS\Language\Text;

defined('_JEXEC') or die('Restricted access');

$reviewSummary = guruHelper::getReviewSummary($displayData->get('course_id'));
$score = floor($reviewSummary->get('score'));
$count = $reviewSummary->get('count');
?>
<span class="guru-review-inline">
    <?php if ($displayData->get('show_score', true)) : ?>
        <span class="guru-review-score"><?php echo number_format($reviewSummary->get('score'), 1) ?></span>
    <?php endif ?>
    <?php if ($displayData->get('show_stars', true)) : ?>
        <span class="guru-review-stars"><?php echo guruHelper::renderRatingScore(['score' => $score]) ?></span>
    <?php endif ?>
    <?php if ($displayData->get('show_count', true)) : ?>
        <span class="guru-review-count">
            <?php 
            echo $count > 1 
                ? Text::sprintf('GURU_NUM_REVIEWS', $count) 
                : Text::sprintf('GURU_NUM_REVIEW', $count);
            ?>
        </span>
    <?php endif ?>
</span>