Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Turn @return into real types on PHP 8 #40154

Closed
@nicolas-grekas

Description

@nicolas-grekas

DebugClassCloader is already able to turn @return annotations into real return types.

We run it in the CI to ensure that type-declarations are in sync with the behavior of the code.

This can be reproduced locally by running:

composer i -o
SYMFONY_PATCH_TYPE_DECLARATIONS=force=1 php .github/patch-types.php

But this doesn't work on union types:

// ignore multi-types return declarations

CodeExtension::getFileLink is one example of a method that should be patched, but isn't right now.

I'm opening this PR to ask for help: this limitation should be removed when PHP 8 is used.

PR welcome :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Help wantedIssues and PRs which are looking for volunteers to complete them.Keep open

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions