Add void return to all views execution hook implementations

Created on 29 November 2024, 19 days ago

Problem/Motivation

See 📌 [META] Add return types to hook implementations Active

Steps to reproduce

grep -P 'Drupal\\\\.*\\\\Hook\\\\.*:\\\\:views(Pre|Post)(View|Build|Execute|Render)\\\\\(\\\\\) has no return type specified' core/.phpstan-baseline.php

Proposed resolution

Add : void to the following hooks in views.api.php:

hook_views_pre_view
hook_views_pre_build
hook_views_post_build
hook_views_pre_execute
hook_views_post_execute
hook_views_pre_render
hook_views_post_render

Add : void to each of these:

Drupal\content_moderation\Hook\ContentModerationHooks::viewsPostExecute()
Drupal\dblog\Hook\DblogHooks::viewsPreRender()
Drupal\media_library\Hook\MediaLibraryHooks::viewsPostRender()
Drupal\media_library\Hook\MediaLibraryHooks::viewsPreRender()
Drupal\rest_test_views\Hook\RestTestViewsHooks::viewsPostExecute()
Drupal\views\Hook\ViewsHooks::viewsPreRender()
Drupal\views_test_config\Hook\ViewsTestConfigHooks::viewsPostRender()
Drupal\views_test_data\Hook\ViewsTestDataViewsExecutionHooks::viewsPostBuild()
Drupal\views_test_data\Hook\ViewsTestDataViewsExecutionHooks::viewsPostExecute()
Drupal\views_test_data\Hook\ViewsTestDataViewsExecutionHooks::viewsPostRender()
Drupal\views_test_data\Hook\ViewsTestDataViewsExecutionHooks::viewsPreBuild()
Drupal\views_test_data\Hook\ViewsTestDataViewsExecutionHooks::viewsPreExecute()
Drupal\views_test_data\Hook\ViewsTestDataViewsExecutionHooks::viewsPreRender()
Drupal\views_test_data\Hook\ViewsTestDataViewsExecutionHooks::viewsPreView()

Update phpstan baseline
./vendor/bin/phpstan --configuration=core/phpstan.neon --generate-baseline=core/.phpstan-baseline.php

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component

views.module

Created by

🇦🇺Australia mstrelan

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024