Skip to content

Support trait abstract method docstring inheritance and validation #10914

@evolbug

Description

@evolbug

Feature request

Hi! Since PHP 8.0, declared abstract trait method signatures are statically enforced at definition time, they are no longer just suggestions, similar to inheriting from an abstract class, so it would make sense if docstrings would also be passed down.

This would avoid the need of copy-pasting docsctrings and having to keep them in sync. There is a previous issue opened by @Firehed in reference to this.

Looking at other trait related issues, it does sound like the might be some challenges in implementing this, is there anything in particular that would prevent this from working?

Did PHPStan help you today? Did it make you happy in any way?

I love PHPStan, it has brought much needed and ever improving strong static analysis I miss from other languages and has kept my code sane!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions