You are here

public function SeoManager::getScoreStatus in Real-time SEO for Drupal 8.2

Get the status for a given score.

@todo Move this back to something like an SEO Assessor.

Parameters

int $score: Score in points.

Return value

string Status corresponding to the score.

File

src/SeoManager.php, line 133

Class

SeoManager
Utility service for the Real-Time SEO module.

Namespace

Drupal\yoast_seo

Code

public function getScoreStatus($score) {
  $rules = $this
    ->getScoreRules();
  foreach ($rules as $minimum => $label) {

    // As soon as our score is bigger than a rules threshold, use that label.
    if ($score >= $minimum) {
      return $label;
    }
  }
  return $this
    ->t('Unknown');
}