Skip to content

False positive private function __clone() is unused #3630

@b1rdex

Description

@b1rdex

https://phpstan.org/r/b8b34edb-7d22-4477-a1a7-4aa532d81c24

This is a pretty common way to forbid cloning the object in PHP: https://github.com/search?q=%22private+function+__clone%28%29%22&type=Code

IMO this shouldn't be reported as unused. It's like private function __construct() in singletons.

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