Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Added new command migrate:middleware-to-request-handler #58

Merged
merged 3 commits into from
Feb 21, 2018
Merged

Added new command migrate:middleware-to-request-handler #58

merged 3 commits into from
Feb 21, 2018

Conversation

michalbundyra
Copy link
Member

Convert PSR-15 middleware to request handler in given path. It should be used to convert final middlewres binded to routes which are not using delegator/request handler.

Works only with PSR-15 middlewares (if you have interop middlewares migrate them first to PSR-15 middlewares by migrate:interop-middleware and then convert them to request handlers).

Convert PSR-15 middleware to request handler in given path.
It should be used to convert final middlewres binded to routes
which are not using delegator/request handler.
Works only with PSR-15 middlewares (if you have interop middlewares
migrate them first to PSR-15 middlewares by migrate:interop-middleware
and then convert them to request handlers).
@weierophinney
Copy link
Member

I would argue that this should raise an exception if it detects any $handler->handle calls.

@michalbundyra
Copy link
Member Author

michalbundyra commented Feb 15, 2018

@weierophinney

I would argue that this should raise an exception if it detects any $handler->handle calls.

I'll try to add this check. I need to find what is the variable name and then look for $var->handle as you said.

When we detect `$handler->handle(` phrase (where variable `$handler` can
be different and it's get from `process` method signature) we are not
going to do any changes in the file.
@@ -0,0 +1,21 @@
<?php

Copy link
Member

Choose a reason for hiding this comment

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

We need a license docblock here and on the other test asset; we should likely also add the declare(strict_types=1), though that's not completely necessary.

@weierophinney weierophinney merged commit 091c2d7 into zendframework:release-1.0.0 Feb 21, 2018
weierophinney added a commit that referenced this pull request Feb 21, 2018
@weierophinney
Copy link
Member

Thanks, @webimpress!

@michalbundyra michalbundyra deleted the feature/migrate-middlewares branch February 22, 2018 07:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants