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

Tiny alteration of the fix in #202 #203

Merged
merged 1 commit into from Apr 28, 2023
Merged

Tiny alteration of the fix in #202 #203

merged 1 commit into from Apr 28, 2023

Conversation

juse-less
Copy link
Contributor

@juse-less juse-less commented Apr 26, 2023

Instead of entirely re-binding the wrapped MiddlewarePipeline Closures, we can just use static Closures, which will prevent it from being bound to the specific instance.
We don't use the MiddlewarePipeline inside the wrapper Closures, and this feels less ugly and hacky than my previous fix (#202).

I also added more clarifying comments to the two wrapper-Closures.

I also noticed that the MiddlewarePipeline and the Pipelines are mutable, so we don't actually need to re-assign the properties.
I therefore removed that unnecessary re-assignment.
I hope that was ok.

@what-the-diff
Copy link

what-the-diff bot commented Apr 26, 2023

PR Summary 🎉

  • Closure made static
    No more binding the closure to an empty class. Now it's directly used in our pipe() call for simpler, more efficient code! 😄

Copy link
Collaborator

@Sammyjo20 Sammyjo20 left a comment

Choose a reason for hiding this comment

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

Thank you :D

@Sammyjo20 Sammyjo20 merged commit 35e1243 into saloonphp:v2 Apr 28, 2023
10 checks passed
@Sammyjo20 Sammyjo20 deleted the bugfix/refactor-earlier-file-handle-fix branch April 28, 2023 22:31
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.

None yet

2 participants