Fix return type on DatasourceInterface::getViewModes

Created on 30 April 2025, 9 days ago

Problem/Motivation

If you implement this interface the right way then PHPStan rightfully starts complaining

 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  184    Method Drupal\my_module\Plugin\search_api\datasource\MyDataSource::getViewModes() should return array<string> but returns array<string,  
         Drupal\Core\StringTranslation\TranslatableMarkup>.                                                                                                                       
         🪪  return.type                  

Steps to reproduce

Proposed resolution

Remaining tasks

🐛 Bug report
Status

Active

Version

1.0

Component

General code

Created by

🇭🇺Hungary mxr576 Hungary

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024