Compley array<> expressions should be allowed in @return comments

Created on 25 May 2025, 8 days ago

Problem/Motivation

This should pass without error:

/**
 * Test that nested array types are ok.
 *
 * @param array<array<scalar|null>|object|scalar|null> $param
 *   A complex nested array type.
 *
 * @return array<array<scalar|null>|object|scalar|null>
 *   An array of results.
 */
function pdo_weird_return_type($param) {
  return pdo();
}

Steps to reproduce

Runs Coder against this example code.

Proposed resolution

Fix doc comment sniff.

Remaining tasks

Finish PR.

API changes

none

🐛 Bug report
Status

Active

Version

8.3

Component

Coder Sniffer

Created by

🇦🇹Austria klausi 🇦🇹 Vienna

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

Comments & Activities

Production build 0.71.5 2024