-
Notifications
You must be signed in to change notification settings - Fork 131
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
Object of class Closure could not be converted to int #121
Comments
Hi Jan Could you share the code that got this exception? Thanks |
Hi @baopham , I have put together the important parts for you. At the end, the desired result comes, nevertheless there is this notice message.
abstract from repository class, which causes the error:
|
Nice. Thanks for the details! |
Thanks for your quick reply!
|
Maybe usefull
Output
|
Ok, although I could not reproduce but there are a few things I don't get:
Because |
Thanks, if I call find() with all keys, it comes to the same issue. Look an this:
The only problem is, that $keys->every() needs an int and gets a bool because of Therefore, this code is never executed (In any case, I never get to this point at debug):
The result does not change for me: I get the desired result from dynamo. I just wanted to help improve the project. |
🤔 I think we may be looking at different versions of Collection because based on the docs, the return value should be bool |
OMG Currently we uses laravel 5.3.x: https://laravel.com/docs/5.3/collections#method-every Good to know! So please mention this in the readme and maybe check your versions in composer.json 😉 |
Nice. Thanks for helping debug this. I'll probably switch to something else more compatible. |
Hi @baopham,
thank you for this great work!
I do not understand the meaning of this passage in the code:
https://github.com/baopham/laravel-dynamodb/blob/master/src/DynamoDbQueryBuilder.php#L851
every() needs an int param, so it comes to this notice:
Object of class Closure could not be converted to int in /..../vendor/laravel/framework/src/Illuminate/Support/Collection.php on line 250
Last lines of stack trace:
PHP 17. BaoPham\DynamoDb\DynamoDbQueryBuilder->find() /.../vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:3561
PHP 18. BaoPham\DynamoDb\DynamoDbQueryBuilder->isMultipleIds() /.../vendor/baopham/dynamodb/src/DynamoDbQueryBuilder.php:416
PHP 19. Illuminate\Support\Collection->every() /.../vendor/baopham/dynamodb/src/DynamoDbQueryBuilder.php:866
Best regards
Jan
The text was updated successfully, but these errors were encountered: