-
-
Notifications
You must be signed in to change notification settings - Fork 315
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
Fix parsing invalid href #502
Fix parsing invalid href #502
Conversation
Sorry you had to see that. This time I tested my changes. I'm also wondering if it would make sense to use the splat operator so we could use if (self::isEmpty($language, $href)) { instead? private function isEmpty(string ...$values): bool
{
$skipValues = array(
'undefined',
);
foreach ($values as $value) {
if (empty($value) || in_array($value, $skipValues)) {
return true;
}
}
return false;
} |
Ok, but the arguments can be of any type, not only The |
If you want to make the helper more "future proof" by allowing all types, I don't think we can continue to use
So
Thanks! I'll change it! |
Additionally, the function was refactored to make use of the splat operator
Since it is not very clear how isEmpty() works, I added a short note to clarify that it returns true if one of the supplied variables is empty (instead of all of them).
Looks good to me. Thanks! |
This is my attempt to fix #501
@oscarotero I wasn't sure what exactly you mean, but maybe something like this?