Skip to content

Conversation

ruudk
Copy link
Collaborator

@ruudk ruudk commented Aug 12, 2025

The Printer is not stateful. So enforcing a singleton serves no purpose (anymore?).

We can easily use new Printer()->printAST($node).

The Printer is not stateful. So enforcing a singleton serves no purpose (anymore?).

We can easily use `new Printer()->printAST($node)`.
@spawnia
Copy link
Collaborator

spawnia commented Aug 12, 2025

Why instantiate the Printer in the first place?

@ruudk
Copy link
Collaborator Author

ruudk commented Aug 12, 2025

Well, it is instantiated, and then statically cached. To me, there is no point in doing this. What was the reason for that?

@spawnia
Copy link
Collaborator

spawnia commented Aug 12, 2025

I would rather make the class completely static then to invite superfluous instantiations.

@ruudk
Copy link
Collaborator Author

ruudk commented Aug 13, 2025

Alright, not worth it as it's a BC break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants