-
Notifications
You must be signed in to change notification settings - Fork 850
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
Wrong invoices count (always 4) #807
Comments
@vedmant I think this is expected behaviour. The code for Assigning to @ob-stripe in case this is something we should reconsider. |
@remi-stripe I see, that's misleading, usually first thing how anyone would check count is to $invoices->count(); it's a collection and logically to try to get results count from it, or count($invoices) as it's implements Countable. |
@brandur-stripe Any thoughts on this? We have the same issue in stripe-ruby and stripe-python (and possibly others). On the one hand, changing the behavior of |
@ob-stripe Good question. I think I'd usually feel adverse to overloading objects to make them seem more like objects they're not — technically the count result of 4 is correct, and there may be cases where you really do want to examine the list object rather than the data it's encapsulating. That said, yep, we're pretty bar down the road of making list objects look like lists already, so I can see the argument for. I'm a little worried that we'd keep finding little holes like this one in the facade, but there's a reasonable chance that count would be the last one. So all in all, I probably wouldn't jump on implementing this, but wouldn't put up any opposition either. |
I also wanted to chime in to this issue. This is true on all list objects. Logically, I would expect that |
Fixed in 7.25.0. |
I have an issue with following:
\Stripe\Stripe::setApiKey($_ENV['STRIPE_KEY']);
$invoices = \Stripe\Invoice::all(['limit' => 100]);
$invoices->count() always returns 4 even if when I iterate over results it clearly shows more records. count($invoices->data) returns correct number of 100.
The text was updated successfully, but these errors were encountered: