-
-
Notifications
You must be signed in to change notification settings - Fork 6.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
Helpers refactoring #1416
Helpers refactoring #1416
Conversation
…renamed StringHelper byte methods not to be misused as string methods
I think we should keep |
I've got at least three people complaining about FS-related stuff is in |
@@ -26,7 +26,7 @@ class BaseStringHelper | |||
* @param string $string the string being measured for length | |||
* @return integer the number of bytes in the given string. | |||
*/ | |||
public static function strlen($string) | |||
public static function byteLen($string) |
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.
Suggest naming it as byteLength()
. We always use full words in names other than those inherited from existing PHP function names.
The functions are provided really just for string manipulation. As you can see, they are used to extract part of the string from class names, etc., which has nothing to do with file systems. I don't think we should create a new class to hold them. The class |
I often use |
I think |
I have to second this: I'd never have expected these methods in Following this logic, the |
|
@mikehaertl for file system you can use the PHP functions basename() and dirname(). The helper is there because the PHP functions do not work on namespaces. |
I understand that. Still I don't really see these methods as generic string related methods. So |
Moved file and path related methods from StringHelper to FileHelper, renamed StringHelper byte methods not to be misused as string methods