Skip to content

@phpstan-consistent-constructor is still unsafe if child class has a private constructor #12137

@herndlm

Description

@herndlm

Bug report

The code produces a fatal error in a static creation context which I thought would be protected via @phpstan-consistent-constructor. See https://3v4l.org/0DfeD

Might be somewhat related to #10722

Code snippet that reproduces the problem

https://phpstan.org/r/b6911e0f-a27e-4ac1-8c6a-02438b29cf10

Expected output

There should be an error reported that the child class has to be at least protected I suppose.

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions