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

Detect Middlewares #28

Merged
merged 11 commits into from
Oct 15, 2017
Merged

Detect Middlewares #28

merged 11 commits into from
Oct 15, 2017

Conversation

stefanzweifel
Copy link
Owner

@stefanzweifel stefanzweifel commented Oct 11, 2017

This PR adds support for Middlewares.
The ReflectionClass resolves the Router and gets declared Middlewares from $middleware and $middlewareGroups. If the given Middleware Classname exists in the Middleware Collection the class has been "recognized".

Known Bugs

  • Middlewares only declared on the $middleware class are currently not recognized 😞

Related Issues

TODOs

  • Fix known bug
  • Refactor Code. It's quite a mess 🤷‍♂️

@stefanzweifel stefanzweifel added this to the 1.0.0 milestone Oct 11, 2017
@stefanzweifel stefanzweifel self-assigned this Oct 11, 2017
@stefanzweifel stefanzweifel changed the title Feature/detect middlewares Detect Middlewares Oct 11, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 98.765% when pulling 2cef3b5 on feature/detect-middlewares into fca3d2c on master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 98.765% when pulling 2cef3b5 on feature/detect-middlewares into fca3d2c on master.

stefanzweifel and others added 6 commits October 14, 2017 21:49
We first resolve the HTTP Kernel and check if the kernel has the given middleware registered.

If the kernel return false on `hasMiddleware` we create a collection of middlewares registered on the router and check if the given Middleware exists in that collection
@stefanzweifel stefanzweifel merged commit 446708f into master Oct 15, 2017
@stefanzweifel stefanzweifel deleted the feature/detect-middlewares branch October 15, 2017 19:26
@AdrianHL
Copy link
Contributor

I have submitted a PR that contains an update to get the route middlewares in addition to the global middlewares: #140.

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.

4 participants