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 https://github.com/pfrenssen/coder/pull/267

API changes

none

Comments

klausi created an issue. See original summary.

klausi’s picture

Title: Compley array<> expressions should be allowed in @return comments » Complex array<> expressions should be allowed in @return comments
Issue summary: View changes

  • klausi authored 6b2edffa on 8.3.x
    fix(FunctionComment): Allow complex array type for return comment (#...
klausi’s picture

Status: Active » Fixed

Merged.

Status: Fixed » Closed (fixed)

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