Problem:

In description of function

   * @return string|NULL
   *   Return the output of the rendered view or NULL if something failed in the
   *   process.
   */
  public function render($display_id = NULL) { 

in views/includes/view.inc the type of the returned parameter is specified incorrectly. This is analyzed through the code analyzer Phan caught error of type PhanTypeExpectedObjectPropAccess in services_views module.

Phan tool reported SEVERITY_CRITICAL issue:
- PhanTypeExpectedObjectPropAccess. Function services_views_execute_view() in services_views/services_views.module: "Expected an object instance when accessing an instance property, but saw an expression $output[$index] with type string"

Steps to reproduce:

run Phan tool ('minimum_target_php_version' => '8.0')

Proposed resolution:

To add type 'array' for @return parameter in description.

Comments

alena_stanul created an issue. See original summary.

alena_stanul’s picture

StatusFileSize
new459 bytes
renatog’s picture

Status: Needs review » Reviewed & tested by the community

Really makes sense to me. Good catch

damienmckenna’s picture

Title: Type of the @return parameter in description of render() is specified incorrectly » Type of the @return parameter in description of render() is incorrect
Status: Reviewed & tested by the community » Fixed
Issue tags: -PHP8.1 +PHP 8.1
Parent issue: » #3232189: Plan for Views 7.x-3.26

Short but sweet. Committed. Thank you.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.