Issue #3494678 by mstrelan, nicxvan: Add void return type to all procedural alter hook implementations
(cherry picked from commit 053c43e3ee
)
merge-requests/10634/head
parent
8d73953f57
commit
75edbfda93
|
@ -12598,12 +12598,6 @@ $ignoreErrors[] = [
|
|||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/ckeditor5/ckeditor5.module',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function ckeditor5_module_implements_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/ckeditor5/ckeditor5.module',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Method Drupal\\\\ckeditor5\\\\Annotation\\\\CKEditor5Plugin\\:\\:setClass\\(\\) has no return type specified\\.$#',
|
||||
|
@ -16552,12 +16546,6 @@ $ignoreErrors[] = [
|
|||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/content_translation/content_translation.module',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function content_translation_module_implements_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/content_translation/content_translation.module',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: variable.undefined
|
||||
'message' => '#^Variable \\$locked_languages might not be defined\\.$#',
|
||||
|
@ -23662,12 +23650,6 @@ $ignoreErrors[] = [
|
|||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/language/tests/src/Unit/Menu/LanguageLocalTasksTest.php',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function layout_builder_module_implements_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/layout_builder/layout_builder.module',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Method Drupal\\\\layout_builder_expose_all_field_blocks\\\\Hook\\\\LayoutBuilderExposeAllFieldBlocksHooks\\:\\:help\\(\\) has no return type specified\\.$#',
|
||||
|
@ -24286,12 +24268,6 @@ $ignoreErrors[] = [
|
|||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/layout_builder/tests/modules/layout_builder_form_block_test/src/Plugin/Block/TestFormApiFormBlock.php',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function layout_builder_test_module_implements_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/layout_builder/tests/modules/layout_builder_test/layout_builder_test.module',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function layout_builder_test_node_view\\(\\) has no return type specified\\.$#',
|
||||
|
@ -27118,12 +27094,6 @@ $ignoreErrors[] = [
|
|||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/media_library/src/Routing/RouteSubscriber.php',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function media_library_form_overwrite_test_media_source_info_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/media_library/tests/modules/media_library_form_overwrite_test/media_library_form_overwrite_test.module',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Method Drupal\\\\media_library_test\\\\Form\\\\TestNodeFormOverride\\:\\:submitForm\\(\\) has no return type specified\\.$#',
|
||||
|
@ -29976,12 +29946,6 @@ $ignoreErrors[] = [
|
|||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/navigation/navigation.install',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function navigation_module_implements_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/navigation/navigation.module',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function navigation_post_update_set_logo_dimensions_default\\(\\) has no return type specified\\.$#',
|
||||
|
@ -36144,24 +36108,12 @@ $ignoreErrors[] = [
|
|||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/system/tests/modules/cache_test/src/Controller/CacheTestController.php',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function common_test_module_implements_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/system/tests/modules/common_test/common_test.module',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function common_test_preprocess\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/system/tests/modules/common_test/common_test.module',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function olivero_drupal_alter_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/system/tests/modules/common_test/common_test.module',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Method Drupal\\\\common_test\\\\Controller\\\\CommonTestController\\:\\:typeLinkActiveClass\\(\\) has no return type specified\\.$#',
|
||||
|
@ -36282,12 +36234,6 @@ $ignoreErrors[] = [
|
|||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/system/tests/modules/delay_cache_tags_invalidation/src/Hook/DelayCacheTagsInvalidationHooks.php',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function deprecation_test_deprecated_alter_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/system/tests/modules/deprecation_test/deprecation_test.module',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function deprecation_test_deprecated_hook\\(\\) has no return type specified\\.$#',
|
||||
|
@ -38767,12 +38713,6 @@ $ignoreErrors[] = [
|
|||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/system/tests/modules/module_test/module_test.module',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function module_test_module_implements_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/system/tests/modules/module_test/module_test.module',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function module_test_modules_installed\\(\\) has no return type specified\\.$#',
|
||||
|
@ -38785,12 +38725,6 @@ $ignoreErrors[] = [
|
|||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/system/tests/modules/module_test/module_test.module',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function module_test_system_info_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/system/tests/modules/module_test/module_test.module',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function module_test_post_update_test\\(\\) has no return type specified\\.$#',
|
||||
|
@ -39741,12 +39675,6 @@ $ignoreErrors[] = [
|
|||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/system/tests/modules/twig_theme_test/twig_theme_test.module',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function unversioned_assets_test_library_info_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/system/tests/modules/unversioned_assets_test/unversioned_assets_test.module',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Method Drupal\\\\update_script_test\\\\Controller\\\\UpdateScriptTestController\\:\\:databaseUpdatesMenuItem\\(\\) has no return type specified\\.$#',
|
||||
|
@ -41655,48 +41583,6 @@ $ignoreErrors[] = [
|
|||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/system/tests/themes/test_subtheme/test_subtheme.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function test_theme_element_info_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/system/tests/themes/test_theme/test_theme.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function test_theme_library_info_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/system/tests/themes/test_theme/test_theme.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function test_theme_theme_registry_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/system/tests/themes/test_theme/test_theme.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function test_theme_theme_suggestions_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/system/tests/themes/test_theme/test_theme.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function test_theme_theme_suggestions_node_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/system/tests/themes/test_theme/test_theme.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function test_theme_theme_suggestions_theme_test_suggestions_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/system/tests/themes/test_theme/test_theme.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function test_theme_theme_test_alter_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/system/tests/themes/test_theme/test_theme.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function test_theme_depending_on_modules_post_update_module_install\\(\\) has no return type specified\\.$#',
|
||||
|
@ -53703,18 +53589,6 @@ $ignoreErrors[] = [
|
|||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function views_ui_test_theme_views_ui_display_tab_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/views_ui/tests/themes/views_ui_test_theme/views_ui_test_theme.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function views_ui_test_theme_views_ui_display_top_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/views_ui/tests/themes/views_ui_test_theme/views_ui_test_theme.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function views_ui_contextual_links_suppress\\(\\) has no return type specified\\.$#',
|
||||
|
@ -55719,12 +55593,6 @@ $ignoreErrors[] = [
|
|||
'count' => 1,
|
||||
'path' => __DIR__ . '/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function umami_theme_suggestions_block_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/profiles/demo_umami/themes/umami/umami.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Method Drupal\\\\Tests\\\\minimal\\\\Functional\\\\MinimalTest\\:\\:assertConfigSchema\\(\\) has no return type specified\\.$#',
|
||||
|
@ -62588,72 +62456,12 @@ $ignoreErrors[] = [
|
|||
'count' => 1,
|
||||
'path' => __DIR__ . '/themes/claro/claro.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function claro_element_info_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/themes/claro/claro.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function claro_page_attachments_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/themes/claro/claro.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function claro_system_module_invoked_library_info_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/themes/claro/claro.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function claro_system_module_invoked_theme_registry_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/themes/claro/claro.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function claro_theme_registry_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/themes/claro/claro.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function claro_theme_suggestions_details_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/themes/claro/claro.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function claro_theme_suggestions_form_element_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/themes/claro/claro.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function claro_theme_suggestions_maintenance_page_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/themes/claro/claro.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function claro_views_pre_render\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/themes/claro/claro.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function claro_views_ui_display_tab_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/themes/claro/claro.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function claro_views_ui_display_top_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/themes/claro/claro.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Method Drupal\\\\claro\\\\ClaroPreRender\\:\\:managedFile\\(\\) has no return type specified\\.$#',
|
||||
|
@ -62690,36 +62498,6 @@ $ignoreErrors[] = [
|
|||
'count' => 1,
|
||||
'path' => __DIR__ . '/themes/engines/twig/twig.engine',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function olivero_element_info_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/themes/olivero/olivero.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function olivero_theme_suggestions_block_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/themes/olivero/olivero.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function olivero_theme_suggestions_form_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/themes/olivero/olivero.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function olivero_theme_suggestions_menu_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/themes/olivero/olivero.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Function olivero_theme_suggestions_user_alter\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/themes/olivero/olivero.theme',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Method Drupal\\\\olivero\\\\OliveroPreRender\\:\\:textFormat\\(\\) has no return type specified\\.$#',
|
||||
|
|
|
@ -20,7 +20,7 @@ use Drupal\Core\Form\FormStateInterface;
|
|||
/**
|
||||
* Implements hook_module_implements_alter().
|
||||
*/
|
||||
function ckeditor5_module_implements_alter(&$implementations, $hook) {
|
||||
function ckeditor5_module_implements_alter(&$implementations, $hook): void {
|
||||
// This module's implementation of form_filter_format_form_alter() must happen
|
||||
// after the editor module's implementation, as that implementation adds the
|
||||
// active editor to $form_state. It must also happen after the media module's
|
||||
|
|
|
@ -13,7 +13,7 @@ use Drupal\Core\Language\LanguageInterface;
|
|||
/**
|
||||
* Implements hook_module_implements_alter().
|
||||
*/
|
||||
function content_translation_module_implements_alter(&$implementations, $hook) {
|
||||
function content_translation_module_implements_alter(&$implementations, $hook): void {
|
||||
switch ($hook) {
|
||||
// Move our hook_entity_type_alter() implementation to the end of the list.
|
||||
case 'entity_type_alter':
|
||||
|
|
|
@ -9,7 +9,7 @@ use Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage;
|
|||
/**
|
||||
* Implements hook_module_implements_alter().
|
||||
*/
|
||||
function layout_builder_module_implements_alter(&$implementations, $hook) {
|
||||
function layout_builder_module_implements_alter(&$implementations, $hook): void {
|
||||
if ($hook === 'entity_view_alter') {
|
||||
// Ensure that this module's implementation of hook_entity_view_alter() runs
|
||||
// last so that other modules that use this hook to render extra fields will
|
||||
|
|
|
@ -53,7 +53,7 @@ function layout_builder_test_preprocess_layout__twocol_section(&$vars): void {
|
|||
/**
|
||||
* Implements hook_module_implements_alter().
|
||||
*/
|
||||
function layout_builder_test_module_implements_alter(&$implementations, $hook) {
|
||||
function layout_builder_test_module_implements_alter(&$implementations, $hook): void {
|
||||
if ($hook === 'system_breadcrumb_alter') {
|
||||
// Move our hook_system_breadcrumb_alter() implementation to run before
|
||||
// layout_builder_system_breadcrumb_alter().
|
||||
|
|
|
@ -9,6 +9,6 @@ declare(strict_types=1);
|
|||
|
||||
use Drupal\media_library_form_overwrite_test\Form\TestAddForm;
|
||||
|
||||
function media_library_form_overwrite_test_media_source_info_alter(array &$sources) {
|
||||
function media_library_form_overwrite_test_media_source_info_alter(array &$sources): void {
|
||||
$sources['image']['forms']['media_library_add'] = TestAddForm::class;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ use Drupal\navigation\TopBarRegion;
|
|||
/**
|
||||
* Implements hook_module_implements_alter().
|
||||
*/
|
||||
function navigation_module_implements_alter(&$implementations, $hook) {
|
||||
function navigation_module_implements_alter(&$implementations, $hook): void {
|
||||
if ($hook == 'page_top') {
|
||||
$group = $implementations['navigation'];
|
||||
unset($implementations['navigation']);
|
||||
|
|
|
@ -13,7 +13,7 @@ declare(strict_types=1);
|
|||
* Same as common_test_drupal_alter_alter(), but here, we verify that themes
|
||||
* can also alter and come last.
|
||||
*/
|
||||
function olivero_drupal_alter_alter(&$data, &$arg2 = NULL, &$arg3 = NULL) {
|
||||
function olivero_drupal_alter_alter(&$data, &$arg2 = NULL, &$arg3 = NULL): void {
|
||||
// Alter first argument.
|
||||
if (is_array($data)) {
|
||||
$data['foo'] .= ' theme';
|
||||
|
@ -46,7 +46,7 @@ function olivero_drupal_alter_alter(&$data, &$arg2 = NULL, &$arg3 = NULL) {
|
|||
*
|
||||
* @see block_drupal_alter_foo_alter()
|
||||
*/
|
||||
function common_test_module_implements_alter(&$implementations, $hook) {
|
||||
function common_test_module_implements_alter(&$implementations, $hook): void {
|
||||
// For
|
||||
// \Drupal::moduleHandler()->alter(array('drupal_alter', 'drupal_alter_foo'), ...),
|
||||
// make the block module implementations run after all the other modules. Note
|
||||
|
|
|
@ -34,6 +34,6 @@ function deprecation_test_deprecated_hook($arg) {
|
|||
/**
|
||||
* Implements hook_deprecated_alter_alter().
|
||||
*/
|
||||
function deprecation_test_deprecated_alter_alter(&$data, $context1, $context2) {
|
||||
function deprecation_test_deprecated_alter_alter(&$data, $context1, $context2): void {
|
||||
$data = [$context1, $context2];
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ use Drupal\Core\Extension\Extension;
|
|||
*
|
||||
* Manipulate module dependencies to test dependency chains.
|
||||
*/
|
||||
function module_test_system_info_alter(&$info, Extension $file, $type) {
|
||||
function module_test_system_info_alter(&$info, Extension $file, $type): void {
|
||||
if (\Drupal::state()->get('module_test.dependency') == 'missing dependency') {
|
||||
if ($file->getName() == 'dblog') {
|
||||
// Make dblog module depend on config.
|
||||
|
@ -102,7 +102,7 @@ function module_test_modules_uninstalled($modules) {
|
|||
* @see module_test_altered_test_hook()
|
||||
* @see \Drupal\system\Tests\Module\ModuleImplementsAlterTest::testModuleImplementsAlter()
|
||||
*/
|
||||
function module_test_module_implements_alter(&$implementations, $hook) {
|
||||
function module_test_module_implements_alter(&$implementations, $hook): void {
|
||||
if ($hook === 'altered_test_hook') {
|
||||
// Add a hook implementation, that will be found in
|
||||
// module_test.implementation.inc.
|
||||
|
|
|
@ -10,7 +10,7 @@ declare(strict_types=1);
|
|||
/**
|
||||
* Implements hook_library_info_build().
|
||||
*/
|
||||
function unversioned_assets_test_library_info_alter(&$libraries, $extension) {
|
||||
function unversioned_assets_test_library_info_alter(&$libraries, $extension): void {
|
||||
if ($extension === 'system') {
|
||||
// Remove the version and provide an additional CSS file we can alter the
|
||||
// contents of .
|
||||
|
|
|
@ -17,7 +17,7 @@ function test_theme_preprocess_twig_theme_test_php_variables(&$variables): void
|
|||
/**
|
||||
* Implements hook_element_info_alter().
|
||||
*/
|
||||
function test_theme_element_info_alter(&$info) {
|
||||
function test_theme_element_info_alter(&$info): void {
|
||||
// Decrease the default size of textfields.
|
||||
if (isset($info['textfield']['#size'])) {
|
||||
$info['textfield']['#size'] = 40;
|
||||
|
@ -27,7 +27,7 @@ function test_theme_element_info_alter(&$info) {
|
|||
/**
|
||||
* Implements hook_library_info_alter().
|
||||
*/
|
||||
function test_theme_library_info_alter(&$libraries, $extension) {
|
||||
function test_theme_library_info_alter(&$libraries, $extension): void {
|
||||
if ($extension === 'test_theme') {
|
||||
$libraries['kitten']['js']['kittens.js'] = [];
|
||||
}
|
||||
|
@ -40,14 +40,14 @@ function test_theme_library_info_alter(&$libraries, $extension) {
|
|||
* the alter hook invoked when the 'theme_test' module calls
|
||||
* \Drupal::moduleHandler->alter('theme_test_alter').
|
||||
*/
|
||||
function test_theme_theme_test_alter_alter(&$data) {
|
||||
function test_theme_theme_test_alter_alter(&$data): void {
|
||||
$data = 'test_theme_theme_test_alter_alter was invoked';
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_theme_suggestions_alter().
|
||||
*/
|
||||
function test_theme_theme_suggestions_alter(array &$suggestions, array &$variables, $hook) {
|
||||
function test_theme_theme_suggestions_alter(array &$suggestions, array &$variables, $hook): void {
|
||||
\Drupal::messenger()->addStatus(__FUNCTION__ . '() executed.');
|
||||
// Theme alter hooks run after module alter hooks, so add this theme
|
||||
// suggestion to the beginning of the array so that the suggestion added by
|
||||
|
@ -62,7 +62,7 @@ function test_theme_theme_suggestions_alter(array &$suggestions, array &$variabl
|
|||
/**
|
||||
* Implements hook_theme_suggestions_HOOK_alter().
|
||||
*/
|
||||
function test_theme_theme_suggestions_theme_test_suggestions_alter(array &$suggestions, array $variables) {
|
||||
function test_theme_theme_suggestions_theme_test_suggestions_alter(array &$suggestions, array $variables): void {
|
||||
\Drupal::messenger()->addStatus(__FUNCTION__ . '() executed.');
|
||||
// Theme alter hooks run after module alter hooks, so add this theme
|
||||
// suggestion to the beginning of the array so that the suggestion added by
|
||||
|
@ -74,7 +74,7 @@ function test_theme_theme_suggestions_theme_test_suggestions_alter(array &$sugge
|
|||
/**
|
||||
* Implements hook_theme_suggestions_HOOK_alter().
|
||||
*/
|
||||
function test_theme_theme_suggestions_node_alter(array &$suggestions, array $variables) {
|
||||
function test_theme_theme_suggestions_node_alter(array &$suggestions, array $variables): void {
|
||||
// Add an invalid suggestion to be tested.
|
||||
$suggestions[] = 'invalid_theme_suggestions';
|
||||
\Drupal::messenger()->addStatus(__FUNCTION__ . '() executed.');
|
||||
|
@ -83,7 +83,7 @@ function test_theme_theme_suggestions_node_alter(array &$suggestions, array $var
|
|||
/**
|
||||
* Implements hook_theme_registry_alter().
|
||||
*/
|
||||
function test_theme_theme_registry_alter(&$registry) {
|
||||
function test_theme_theme_registry_alter(&$registry): void {
|
||||
$registry['theme_test_template_test']['variables']['additional'] = 'value';
|
||||
}
|
||||
|
||||
|
|
|
@ -12,13 +12,13 @@ use Drupal\views_ui\ViewUI;
|
|||
/**
|
||||
* Implements hook_views_ui_display_tab_alter().
|
||||
*/
|
||||
function views_ui_test_theme_views_ui_display_tab_alter(&$build, ViewUI $view, $display_id) {
|
||||
function views_ui_test_theme_views_ui_display_tab_alter(&$build, ViewUI $view, $display_id): void {
|
||||
$build['details']['top']['display_title']['#description'] = 'This is text added to the display edit form';
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_views_ui_display_top_alter().
|
||||
*/
|
||||
function views_ui_test_theme_views_ui_display_top_alter(&$build, ViewUI $view, $display_id) {
|
||||
function views_ui_test_theme_views_ui_display_top_alter(&$build, ViewUI $view, $display_id): void {
|
||||
$build['tabs']['#suffix'] .= 'This is text added to the display tabs at the top';
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ function umami_preprocess_block(&$variables): void {
|
|||
/**
|
||||
* Implements hook_theme_suggestions_HOOK_alter() for block templates.
|
||||
*/
|
||||
function umami_theme_suggestions_block_alter(array &$suggestions, array $variables) {
|
||||
function umami_theme_suggestions_block_alter(array &$suggestions, array $variables): void {
|
||||
// Block suggestions for content block bundles.
|
||||
if (isset($variables['elements']['content']['#block_content'])) {
|
||||
array_splice($suggestions, 1, 0, 'block__bundle__' . $variables['elements']['content']['#block_content']->bundle());
|
||||
|
|
|
@ -24,7 +24,7 @@ use Drupal\views_ui\Form\Ajax\ViewsFormInterface;
|
|||
/**
|
||||
* Implements hook_theme_suggestions_HOOK_alter() for form_element.
|
||||
*/
|
||||
function claro_theme_suggestions_form_element_alter(&$suggestions, $variables) {
|
||||
function claro_theme_suggestions_form_element_alter(&$suggestions, $variables): void {
|
||||
if (!empty($variables['element']['#type'])) {
|
||||
$suggestions[] = 'form_element__' . $variables['element']['#type'];
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ function claro_theme_suggestions_form_element_alter(&$suggestions, $variables) {
|
|||
/**
|
||||
* Implements hook_theme_suggestions_HOOK_alter() for details.
|
||||
*/
|
||||
function claro_theme_suggestions_details_alter(&$suggestions, $variables) {
|
||||
function claro_theme_suggestions_details_alter(&$suggestions, $variables): void {
|
||||
if (!empty($variables['element']['#vertical_tab_item'])) {
|
||||
$suggestions[] = 'details__vertical_tabs';
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ function claro_theme_suggestions_details_alter(&$suggestions, $variables) {
|
|||
/**
|
||||
* Implements hook_page_attachments_alter().
|
||||
*/
|
||||
function claro_page_attachments_alter(array &$attachments) {
|
||||
function claro_page_attachments_alter(array &$attachments): void {
|
||||
$theme_path = \Drupal::request()->getBasePath() . '/' . \Drupal::service('extension.list.theme')->getPath('claro');
|
||||
$query_string = \Drupal::service('asset.query_string')->get();
|
||||
|
||||
|
@ -263,7 +263,7 @@ function claro_preprocess_menu_local_action(array &$variables): void {
|
|||
/**
|
||||
* Implements hook_element_info_alter().
|
||||
*/
|
||||
function claro_element_info_alter(&$type) {
|
||||
function claro_element_info_alter(&$type): void {
|
||||
// Add a pre-render function that handles the sidebar of the node form.
|
||||
// @todo Refactor when https://www.drupal.org/node/3056089 is in.
|
||||
if (isset($type['container'])) {
|
||||
|
@ -326,7 +326,7 @@ function claro_preprocess_text_format_wrapper(&$variables): void {
|
|||
/**
|
||||
* Implements hook_theme_registry_alter().
|
||||
*/
|
||||
function claro_theme_registry_alter(&$theme_registry) {
|
||||
function claro_theme_registry_alter(&$theme_registry): void {
|
||||
if (!empty($theme_registry['admin_block_content'])) {
|
||||
$theme_registry['admin_block_content']['variables']['attributes'] = [];
|
||||
}
|
||||
|
@ -356,7 +356,7 @@ function claro_preprocess_maintenance_page(&$variables): void {
|
|||
/**
|
||||
* Implements hook_theme_suggestions_maintenance_page_alter().
|
||||
*/
|
||||
function claro_theme_suggestions_maintenance_page_alter(&$suggestions) {
|
||||
function claro_theme_suggestions_maintenance_page_alter(&$suggestions): void {
|
||||
try {
|
||||
$is_front = \Drupal::service('path.matcher')->isFrontPage();
|
||||
}
|
||||
|
@ -761,7 +761,7 @@ function claro_form_media_form_alter(&$form, FormStateInterface $form_state): vo
|
|||
/**
|
||||
* Implements hook_views_ui_display_top_alter().
|
||||
*/
|
||||
function claro_views_ui_display_top_alter(&$element) {
|
||||
function claro_views_ui_display_top_alter(&$element): void {
|
||||
// @todo Remove this after https://www.drupal.org/node/3051605 has been
|
||||
// solved.
|
||||
$element['tabs']['#prefix'] = preg_replace('/(class="(.+\s)?)tabs(\s.+"|")/', '$1views-tabs$3', $element['tabs']['#prefix']);
|
||||
|
@ -806,7 +806,7 @@ function claro_views_ui_display_top_alter(&$element) {
|
|||
/**
|
||||
* Implements hook_views_ui_display_tab_alter().
|
||||
*/
|
||||
function claro_views_ui_display_tab_alter(&$element) {
|
||||
function claro_views_ui_display_tab_alter(&$element): void {
|
||||
// We process the dropbutton-like element on views edit form's
|
||||
// display settings top section.
|
||||
//
|
||||
|
@ -1802,7 +1802,7 @@ function claro_preprocess_toolbar(&$variables, $hook, $info): void {
|
|||
*
|
||||
* @see system_library_info_alter()
|
||||
*/
|
||||
function claro_system_module_invoked_library_info_alter(&$libraries, $extension) {
|
||||
function claro_system_module_invoked_library_info_alter(&$libraries, $extension): void {
|
||||
if ($extension === 'toolbar') {
|
||||
$claro_info = \Drupal::service('theme_handler')->listInfo()['claro']->info;
|
||||
$path_prefix = '/core/themes/claro/';
|
||||
|
@ -1833,7 +1833,7 @@ function claro_system_module_invoked_library_info_alter(&$libraries, $extension)
|
|||
*
|
||||
* @see system_theme_registry_alter()
|
||||
*/
|
||||
function claro_system_module_invoked_theme_registry_alter(array &$theme_registry) {
|
||||
function claro_system_module_invoked_theme_registry_alter(array &$theme_registry): void {
|
||||
foreach (['toolbar', 'menu__toolbar'] as $registry_item) {
|
||||
if (isset($theme_registry[$registry_item])) {
|
||||
$theme_registry[$registry_item]['path'] = 'core/themes/claro/templates/navigation';
|
||||
|
|
|
@ -162,7 +162,7 @@ function olivero_preprocess_block(&$variables): void {
|
|||
/**
|
||||
* Implements hook_theme_suggestions_HOOK_alter() for menu.
|
||||
*/
|
||||
function olivero_theme_suggestions_menu_alter(&$suggestions, array $variables) {
|
||||
function olivero_theme_suggestions_menu_alter(&$suggestions, array $variables): void {
|
||||
if (isset($variables['attributes']['region'])) {
|
||||
$suggestions[] = 'menu__' . $variables['attributes']['region'];
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ function olivero_preprocess_menu(&$variables): void {
|
|||
/**
|
||||
* Implements hook_theme_suggestions_HOOK_alter() for form templates.
|
||||
*/
|
||||
function olivero_theme_suggestions_form_alter(array &$suggestions, array $variables) {
|
||||
function olivero_theme_suggestions_form_alter(array &$suggestions, array $variables): void {
|
||||
if ($variables['element']['#form_id'] === 'search_block_form') {
|
||||
$suggestions[] = 'form__search_block_form';
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ function olivero_form_alter(&$form, FormStateInterface $form_state, $form_id): v
|
|||
/**
|
||||
* Implements hook_theme_suggestions_HOOK_alter() for block().
|
||||
*/
|
||||
function olivero_theme_suggestions_block_alter(&$suggestions, array $variables) {
|
||||
function olivero_theme_suggestions_block_alter(&$suggestions, array $variables): void {
|
||||
if (!empty($variables['elements']['#id'])) {
|
||||
|
||||
/** @var \Drupal\block\BlockInterface $block */
|
||||
|
@ -480,7 +480,7 @@ function olivero_preprocess_fieldset(&$variables): void {
|
|||
/**
|
||||
* Implements hook_theme_suggestions_HOOK_alter().
|
||||
*/
|
||||
function olivero_theme_suggestions_user_alter(&$suggestions, $variables) {
|
||||
function olivero_theme_suggestions_user_alter(&$suggestions, $variables): void {
|
||||
$suggestions[] = 'user__' . $variables['elements']['#view_mode'];
|
||||
}
|
||||
|
||||
|
@ -545,7 +545,7 @@ function olivero_preprocess_field__comment(&$variables): void {
|
|||
/**
|
||||
* Implements hook_element_info_alter().
|
||||
*/
|
||||
function olivero_element_info_alter(&$info) {
|
||||
function olivero_element_info_alter(&$info): void {
|
||||
if (array_key_exists('text_format', $info)) {
|
||||
$info['text_format']['#pre_render'][] = [OliveroPreRender::class, 'textFormat'];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue