phpDocumentor / phpDocumentor/ReflectionDocBlock

Add @template & Conditional return types

Open
#372 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
9.4k
Forks
137
Avg merge
4d 2h
Merged PRs (30d)
1

Description

https://phpstan.org/writing-php-code/phpdoc-types#conditional-return-types

@template T of int|array
@return (T is int ? static : array)

I am not sure that you support psalm-types too

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked PHPStan conditional return types documentation and inspect how ReflectionDocBlock currently parses @template and @return annotations. Determine whether the shown syntax and Psalm-style types are supported, then use the project's existing type-parsing tests to define the expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.