Skip to content
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

[1.x] Fixes rebound closures serialization #19

Merged
merged 4 commits into from
Sep 29, 2021

Conversation

nunomaduro
Copy link
Member

@nunomaduro nunomaduro commented Sep 29, 2021

This pull request fixes serialization closures that got rebounded. There was missing a "from" method.

Fixes #18

@taylorotwell taylorotwell merged commit 11e5e1b into master Sep 29, 2021
@taylorotwell taylorotwell deleted the fix/rebound-closures branch September 29, 2021 13:18
@yaroslawww
Copy link

yaroslawww commented Sep 29, 2021

@nunomaduro
Thank you for fix but now I see other error when run unit tests with "PendingChainFake" (Bus::fake()).

this is error:

TypeError: Opis\Closure\ReflectionClosure::__construct(): Argument #1 ($closure) must be of type Closure, Laravel\SerializableClosure\Serializers\Native given, called in .../vendor/opis/closure/src/SerializableClosure.php on line 97 and defined in .../vendor/opis/closure/src/ReflectionClosure.php:41

All works correct on laravel 8.60.0 but not on 8.61.0 and 8.62.0

@nunomaduro
Copy link
Member Author

nunomaduro commented Sep 29, 2021

Can you give me an example @yaroslawww on how to reproduce that? Also, can you ensure you are using the version v1.0.2 of this package? What PHP version are you using?

@yaroslawww
Copy link

@nunomaduro Sorry, after research I found problem in other private internal package what use "Illuminate\Queue\SerializableClosure" as wrapper for closure called in queue. After change from "Illuminate\Queue\SerializableClosure" => "Laravel\SerializableClosure\Serializers\Native" all tests passed and functionality works.

Thank you for great work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Call to undefined method Laravel\SerializableClosure\Serializers\Native::from()
3 participants