You are here

function simple_instagram_feed_requirements in Simple Instagram Feed Block 8.3

Implements hook_requirements().

File

./simple_instagram_feed.install, line 29
Install, update and uninstall for simple instagram feed module.

Code

function simple_instagram_feed_requirements($phase) {
  if ($phase !== 'runtime') {
    return [];
  }
  $simpleInstagramFeedLibrary = \Drupal::service('simple_instagram_feed.library');
  $exists = $simpleInstagramFeedLibrary
    ->isAvailable();
  return [
    'simple_instagram_feed_library' => [
      'title' => t('Simple instagram feed library'),
      'description' => $exists ? '' : $simpleInstagramFeedLibrary
        ->getWarningMessage(),
      'severity' => $exists ? REQUIREMENT_OK : REQUIREMENT_ERROR,
      'value' => $exists ? t('Installed') : t('Not installed'),
    ],
  ];
}