Skip to content
Discussion options

You must be logged in to vote

I was unaware people are using create() for helpers classes. Those really should be abstract since they are have exclusively static methods, and are not intended to ever be instantiated.

And that warning is correct @wsydney76. Even if you can instantiate them, you shouldn’t be treating static methods as instance-level methods.

That said, I went ahead and adjusted create() to allow craft\helpers\* classes to be created for the next release, as there’s no security concern with them. (fae1c5f)

We can figure out a better solution in Craft 6.

Replies: 5 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@jamesmacwhite
Comment options

Comment options

You must be logged in to vote
1 reply
@jamesmacwhite
Comment options

Comment options

You must be logged in to vote
4 replies
@jamesmacwhite
Comment options

@brandonkelly
Comment options

@FrankZwiers
Comment options

@brandonkelly
Comment options

Answer selected by brandonkelly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants