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

Replace opis/closure with laravel/serializable-closure #31

Merged
merged 1 commit into from
Oct 20, 2021
Merged

Replace opis/closure with laravel/serializable-closure #31

merged 1 commit into from
Oct 20, 2021

Conversation

mabdullahsari
Copy link
Contributor

@mabdullahsari mabdullahsari commented Oct 15, 2021

Closes #30.

  • The type-hint change from callable to Closure in the Route macro is technically a breaking change, but the chances somebody is using anything but a Closure as a callable is very very slim. The charm of this package is the ability to use Closures in the route definition. 🤙🏻 (This is needed because Laravel's SerializableClosure only accepts actual Closures.)
  • Laravel now handles the security in EncryptionServiceProvider, it is probably safe to omit the temporary security provider overrides in the middleware.
  • Since no behavior was altered at all, I did not add/remove any tests.

if ($securityProvider !== null) {
SerializableClosure::addSecurityProvider($securityProvider);
}

if (is_a($callback, SerializableClosure::class)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why this check is there, so did not touch it. Is it ever possible to receive something other than a SerializableClosure?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not find an expectation of a type other than SerializableClosure. Removed check. Thanks

@tabuna tabuna merged commit 4109765 into tabuna:master Oct 20, 2021
@tabuna tabuna mentioned this pull request Oct 20, 2021
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.

Laravel's serializable closures
2 participants