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

Expressive 3.0.0alpha1 - PHP 7.1 updates #530

Closed
wants to merge 7 commits into from
Closed

Expressive 3.0.0alpha1 - PHP 7.1 updates #530

wants to merge 7 commits into from

Conversation

michalbundyra
Copy link
Member

Based on #529

  • strict types
  • added typehints
  • added return types
  • removed redundant tags in PHPDocs

"fig/http-message-util": "^1.1.2",
"http-interop/http-middleware": "^0.4.1",
"http-interop/http-server-middleware": "^1.0.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we explicity require http-interop/http-server-handler as well?

Copy link
Member

Choose a reason for hiding this comment

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

No, because http-server-middleware already requires it (as the interface it defines is type-hinted against within MiddlewareInterface).

@@ -82,7 +139,7 @@ One note: the `$request` argument does not require a typehint, and examples
throughout the manual will omit the typehint when demonstrating callable
middleware.

## Double-pass middleware
## Double-pass middleware (Expressive 1.X and 2.X)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should add a note that it is supported in 3.x via DoublePassMiddlewareWrapper?

@@ -130,6 +130,9 @@ its way back out the onion.
>
> Expressive 2.X still supports double-pass middleware, though we recommend the
> lambda style.
>
> Expressive 3.0 does not longer support double-pass middleware. Please use
Copy link
Contributor

Choose a reason for hiding this comment

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

Unless using DoublePassMiddlewareWrapper

use Zend\Expressive\Template\TemplateRendererInterface;

class NotFoundDelegate implements DelegateInterface
class NotFoundDelegate implements RequestHandlerInterface
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we rename it back to NotFoundHandler?

use Psr\Http\Message\ServerRequestInterface;
use Slim\Flash\Messages;

class SlimFlashMiddleware implements MiddlewareInterface
{
public function process(ServerRequestInterface $request, DelegateInterface $delegate)
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the space before colon part of ZF coding standard? The PSR-12 draft recommends using no space before the colon.

Copy link
Member

Choose a reason for hiding this comment

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

Yes. And PSR-12 is not doing a hard-recommendation on it, only a soft one.

"zendframework/zend-coding-standard": "~1.0.0",
"zendframework/zend-expressive-aurarouter": "^2.0",
"zendframework/zend-expressive-fastroute": "^2.0",
"zendframework/zend-expressive-zendrouter": "^2.0.1",
"zendframework/zend-servicemanager": "^3.3 || ^2.7.8"
"zendframework/zend-servicemanager": "^2.7.8 || ^3.3"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can drop 2.7 support

Copy link
Member Author

Choose a reason for hiding this comment

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

@weierophinney Can we?

"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.
We don't need to have Exception and Throwable as we support only PHP 7.1+
Added typehint for Throwable
- added typehints
- added return types
- removed redundant tags in PHPDocs
@weierophinney weierophinney added this to the 3.0.0alpha1 milestone Dec 5, 2017
@michalbundyra
Copy link
Member Author

Closing in favour of #529

It's impossible to split these PRs right now, as we have many dev-v3 component which already use many PHP 7.1+ features, and we need them in the same PR where adding PSR-15 support.

@michalbundyra michalbundyra deleted the feature/php-7.1 branch December 7, 2017 13:06
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.

4 participants