telephone_type.install 590 Bytes
Newer Older
seworthi's avatar
seworthi committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
<?php

/**
 * @file
 * Installation hooks.
 */

/**
 * Implements hook_requirements().
 */
function telephone_type_requirements($phase) {
  $requirements = [];

  if ($phase == 'install') {
    if (!class_exists('\\libphonenumber\\PhoneNumberUtil')) {
      $requirements['telephone_type'] = [
        'title' => t('Composer dependencies'),
        'description' => t('This module can be only installed with Composer as it uses composer dependencies. Read more on https://www.drupal.org/node/2718229'),
        'severity' => REQUIREMENT_ERROR,
      ];
    }
  }

  return $requirements;
}