function AnnounceFetcher::isRelevantItem

Same name and namespace in other branches
  1. 10 core/modules/announcements_feed/src/AnnounceFetcher.php \Drupal\announcements_feed\AnnounceFetcher::isRelevantItem()

Check whether the version given is relevant to the Drupal version used.

Parameters

string $version: Version to check.

Return value

bool Return True if the version matches Drupal version.

1 call to AnnounceFetcher::isRelevantItem()
AnnounceFetcher::fetch in core/modules/announcements_feed/src/AnnounceFetcher.php
Fetches the feed either from a local cache or fresh remotely.

File

core/modules/announcements_feed/src/AnnounceFetcher.php, line 82

Class

AnnounceFetcher
Service to fetch announcements from the external feed.

Namespace

Drupal\announcements_feed

Code

protected static function isRelevantItem(string $version) : bool {
    return !empty($version) && Semver::satisfies(\Drupal::VERSION, $version);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.