-
Notifications
You must be signed in to change notification settings - Fork 95
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
Map::ksort TypeError on null comparator #134
Comments
Good catch! I'll fix this asap. I'm curious - why wrap around? |
@rtheunissen I think there were a couple of other methods that did the same, but I just assumed they didn't accept a nullable argument. In terms of wrapping, I'm adding a couple more methods that work with what people expect from 'collections'. I'm also adding little features such as enforced types and value/key normalisation. I've also added a few mutable and immutable versions of methods, so The actual class that I mentioned above is here: https://github.com/contraption/accumulator/blob/develop/src/Map.php |
@ollieread we're going to rewrite parameter parsing for 2.0 that will fix this issue. I would recommend using |
@rtheunissen does the splat operator work if args is null/empty? |
When calling the
ksort()
method onDs\Map
I get the following error if the parameter isnull
or a variable that isnull
.Omitting the parameter entirely works without issue.
The reason I'm running into this issue is that I actually have a few classes that basically wrap around the DS data structures. The particular method I have that causes this issue, is:
In this case
$this->items
is an instance ofDs\Map
.The text was updated successfully, but these errors were encountered: