-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Replace jeremeamia/superclosure with opis/closure #37238
Conversation
Codecov Report
@@ Coverage Diff @@
## master #37238 +/- ##
=========================================
Coverage 64.92% 64.92%
- Complexity 19148 19149 +1
=========================================
Files 1267 1267
Lines 74895 74896 +1
Branches 1331 1331
=========================================
+ Hits 48626 48627 +1
Misses 25877 25877
Partials 392 392
Continue to review full report at Codecov.
|
6a7bf2f
to
d7a55bd
Compare
|
||
class ClosureJob extends QueuedJob { | ||
protected function run($serializedCallable) { | ||
$serializer = new Serializer(); | ||
$callable = $serializer->unserialize($serializedCallable); | ||
$serializedClosure = \unserialize($serializedCallable); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compare result with false
to avoid getClosure()
on false
below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used method_exists
because it is also nice to know that the unserialized "thing" is an object that has the required method. I checked that if $serializedClosure
is not even an object (e.g. is false
or "abc" or...) then method_exists
happily returns false.
d7a55bd
to
586693a
Compare
Description
jeremeamia/superclosure
library is no longer maintained and is only officially tested up to PHP 7.2.https://github.com/jeremeamia/super_closure/blob/master/README.md
Replace it with the recommended https://github.com/opis/closure library.
This happens to also get rid of some
symfony/polyfill
dependencies.And means we are using a dependency that is officially tested on PHP 7.3 and 7.4
How Has This Been Tested?
CI and local run of unit tests:
Types of changes
Checklist: