Skip to content
This repository was archived by the owner on Dec 6, 2024. It is now read-only.
This repository was archived by the owner on Dec 6, 2024. It is now read-only.

Static approach makes this class unmockable #9

@func0der

Description

@func0der

Hey there,

I found that you class seems to be unmockable for PHPUnit, because all its calls are static and the state is saved staticalled, too.

I could imagine, why you would have chosen this approach, but it hinders us from mocking it away.

Do you see a way of combining a 'correct' stateful approach with your easy accessible static one? Maybe with the singleton pattern for example?
With this approach there would be almost to none changes to your existing public api, because you could hide the instanciating process in your class.
Or maybe something else, like a new major with a compatibility break?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions