Same name and namespace in other branches
  1. 8.9.x core/modules/system/tests/modules/theme_test/theme_test.module \theme_test_system_info_alter()
  2. 9 core/modules/system/tests/modules/theme_test/theme_test.module \theme_test_system_info_alter()

Implements hook_system_info_alter().

See also

\Drupal\system\Tests\Theme\ThemeInfoTest::testChanges()

File

core/modules/system/tests/modules/theme_test/theme_test.module, line 180
Test module.

Code

function theme_test_system_info_alter(array &$info, Extension $file, $type) {
  if ($type == 'theme' && $file
    ->getName() == 'test_theme' && \Drupal::state()
    ->get('theme_test.modify_info_files')) {

    // Add a library to see if the system picks it up.
    $info += [
      'libraries' => [],
    ];
    $info['libraries'][] = 'core/once';
  }
}