Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Turn @return into real types on PHP 8 #40154

Copy link
Copy link
Closed
@nicolas-grekas

Description

@nicolas-grekas
Issue body actions

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.Issues 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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.