You are here

function lightning_api_requirements in Lightning API 8.4

Implements hook_requirements().

File

./lightning_api.install, line 206
Contains installation and update routines for Lightning API.

Code

function lightning_api_requirements($phase) {
  $requirements = [];
  if ($phase === 'runtime' && Drupal::moduleHandler()
    ->moduleExists('openapi_rest')) {
    $requirements['openapi_rest_deprecated_dependency'] = [
      'title' => t('Deprecated dependency: OpenAPI REST'),
      'description' => t('The OpenAPI REST module currently ships with Lightning API, but it will not in Lightning API 5.0. If you intend to continue using it, you should explicitly add it to your project now, for example: <code>composer require drupal/openapi_rest</code>. Otherwise, you may want to <a href=":uninstall_url">uninstall it now</a>.', [
        ':uninstall_url' => Url::fromRoute('system.modules_uninstall')
          ->toString(),
      ]),
      'severity' => REQUIREMENT_WARNING,
    ];
  }
  return $requirements;
}