-
Notifications
You must be signed in to change notification settings - Fork 196
PSR-15 support (http-interop/http-server-middleware) + PHP 7.1 #529
PSR-15 support (http-interop/http-server-middleware) + PHP 7.1 #529
Conversation
- dropped PHP 5.6 and 7.0 - updated Travis CI configuration
Probably worth linking to the discussion on this for anyone researching: https://discourse.zendframework.com/t/psr-15-compatibility-issues-and-proposal/378 |
"responsePrototype" has been removed in MiddlewarePipe so it has been added here to Application as provate property and Application has one more not mandatory parameter in costructor Default, as before, response prototype is initialized with Zend\Diactoros\Response New wrappers (decorators) are used.
Added return type declaration on "pipe" method of Application. We return $this, but parrent method has "self" return type declared. Here we have to use "parent" and in PHPDocs we can point that it is "self".
composer.json
Outdated
"zendframework/zend-diactoros": "^1.3.10", | ||
"zendframework/zend-expressive-router": "^2.2", | ||
"zendframework/zend-expressive-router": "dev-feature/psr-15 as 2.2", |
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.
You can now pin this to 3.0.x-dev or dev-release-3.0.0.
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.
Unfortunately for now we need to have 3.0.x-dev as 2.3
as expressive-*router libraries does not support v3 yet. I'm going to work on it soon.
composer.json
Outdated
"type": "git", | ||
"url": "https://github.com/webimpress/zend-expressive-router.git" | ||
} | ||
], |
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.
You can remove this now.
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.
Removed.
composer.json
Outdated
"zendframework/zend-expressive-template": "^1.0.4", | ||
"zendframework/zend-stratigility": "^2.1" | ||
"zendframework/zend-stratigility": "dev-release-3.0.0" |
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.
Maybe try one of the following constraints:
^3.0.0@dev
^3.0.0@dev as 3.0.0alpha1
^3.0.0-dev
^3.0.0-dev as 3.0.0alpha1
My understanding is that we should use semver constraints instead of the branch name if an alias exists; I just can't recall off the top of my head what that should look like. Experiment! 😁
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.
Looks like ^3.0.0@dev
and ^3.0.0-dev
are the same, when I try with alias I got error:
Problem 1
- The requested package zendframework/zend-stratigility ^3.0.0@dev as 3.0.0alpha1 exists as zendframework/zend-stratigility[1.0.0, 1.0.1, 1.0.2, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.2.0, 1.2.1, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 2.0.0, 2.0.1, 2.1.0, 2.1.1, 2.1.2, dev-develop, 2.2.x-dev, dev-master, 2.1.x-dev, dev-release-3.0.0, 3.0.x-dev] but these are rejected by your constraint.
We don't need to have Exception and Throwable as we support only PHP 7.1+ Added typehint for Throwable
@weierophinney because we decided to typehint on Other that than we have some issues in test caused by bug in prophecy, please see: |
This is not true. In the v2 series, Currently, the only way the middleware passed to a |
We are waiting for release, this is to have less tests failing...
Now zend-expressive-router RouteResult::fromRouteFailure() requires parameter. It resolves prophecy issue and it's more clear because we have to provide parameter explicitly
- Removed default value from $middleware - added type hint on $name to string - fixed doc-block
Because we have typehints we are expecting now TypeError. We have it got in all these cases because we declare strict_types.
$middleware can't be now omitted, in case we pas null we got InvalidMiddlewareException
@webimpress Do not worry about rebasing; I've almost completed the merge locally, and will push to release-3.0.0 shortly. |
PSR-15 support (http-interop/http-server-middleware) + PHP 7.1 Conflicts: .travis.yml composer.json composer.lock docs/book/cookbook/passing-data-between-middleware.md docs/book/cookbook/setting-locale-without-routing-parameter.md docs/book/cookbook/using-routed-middleware-class-as-controller.md docs/book/features/middleware-types.md docs/book/getting-started/skeleton.md src/Application.php src/Delegate/NotFoundDelegate.php src/MarshalMiddlewareTrait.php src/Middleware/DispatchMiddleware.php src/Middleware/ImplicitHeadMiddleware.php src/Middleware/ImplicitOptionsMiddleware.php src/Middleware/LazyLoadingMiddleware.php src/Middleware/NotFoundHandler.php src/Middleware/RouteMiddleware.php test/Application/MarshalMiddlewareTraitTest.php test/Application/TestAsset/CallableInteropMiddleware.php test/Application/TestAsset/InteropMiddleware.php test/ApplicationTest.php test/Container/ApplicationFactoryTest.php test/IntegrationTest.php test/Middleware/DispatchMiddlewareTest.php test/Middleware/ImplicitHeadMiddlewareTest.php test/Middleware/ImplicitOptionsMiddlewareTest.php test/Middleware/LazyLoadingMiddlewareTest.php test/Middleware/NotFoundHandlerTest.php test/Middleware/RouteMiddlewareTest.php test/Router/IntegrationTest.php test/TestAsset/CallableInteropMiddleware.php test/TestAsset/InteropMiddleware.php
Thanks, @webimpress! |
Requires:
We need update the docs, and remove probably some functionality like double-pass middlewares.