Add array return to all hook_views_data and hook_field_views_data implementations

Created on 29 November 2024, 5 months ago

Problem/Motivation

See πŸ“Œ [META] Add return types to hook implementations Active

Steps to reproduce

grep -P 'Drupal\\\\.*\\\\Hook\\\\.*:\\\\:(viewsData|fieldViewsData)\\\\\(\\\\\) has no return type specified' core/.phpstan-baseline.php

Proposed resolution

Add : array to hook_views_data and hook_field_views_data in views.api.php

Add : array to each of these:

Drupal\content_moderation\Hook\ContentModerationViewsHooks::viewsData()
Drupal\datetime\Hook\DatetimeViewsHooks::fieldViewsData()
Drupal\datetime_range\Hook\DatetimeRangeViewsHooks::fieldViewsData()
Drupal\dblog\Hook\DblogViewsHooks::viewsData()
Drupal\file\Hook\FileViewsHooks::fieldViewsData()
Drupal\history\Hook\HistoryViewsHooks::viewsData()
Drupal\image\Hook\ImageViewsHooks::fieldViewsData()
Drupal\media_library\Hook\MediaLibraryViewsHooks::viewsData()
Drupal\options\Hook\OptionsViewsHooks::fieldViewsData()
Drupal\views\Hook\ViewsViewsHooks::fieldViewsData()
Drupal\views\Hook\ViewsViewsHooks::viewsData()
Drupal\views_test_data\Hook\ViewsTestDataViewsExecutionHooks::fieldViewsData()
Drupal\views_test_data\Hook\ViewsTestDataViewsHooks::viewsData()
Drupal\views_ui_test_field\Hook\ViewsUiTestFieldViewsHooks::viewsData()

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