-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: move ArrayHelper class #8130
Conversation
2502519
to
629a1c1
Compare
15f7804
to
3d167be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this is the right place for the ArrayHelper
class, but I guess it may be.
Since the removed class wasn't marked as internal, we should mention this in the changelog as a breaking change.
/** | ||
* @see \CodeIgniter\Helpers\Array\ArrayHelperRecursiveDiffTest | ||
*/ | ||
final class ArrayHelper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a huge fan of making this type of class final
, since there might be some use cases that can benefit from extending this class. However, it's not a deal breaker for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you need it really, I will remove final
.
But we can remove it anytime when request comes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel like we need it here, but I may be the only one, so that's cool. And you're right, we can always remove it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's wait for others opinions.
You mean So I think the changelog is not needed in this case. |
Okay, I missed that it's a new feature. In that case, no changelog entry is needed. Thanks. |
I added |
If someone thinks it is better not to have |
Unless there is a compelling reason for a class not to be I am opposed to transitioning functions to public static methods just for the sake of having them in classes. If there is a case-by-case basis (like code reuse) we can look at individual files. |
In general, I'm against static classes and using them instead of helper functions - I see no advantage at all. When it comes to the |
Description
ArrayHelper
class tosystem/Helpers/Array
array_helper.php
toArrayHelper.php
Checklist: