Do you have any suggestions for a better name?
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/d892ba6d-2887-4968-bf89-09b45b0d3625%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Where did the word "Frame" come from and in what context is it used. It means nothing to me and I don't think I'm alone in having no clue how I would be able to infer that $frame might have a next() method. It's very weird and I think it's a negative when looking at the function signature as it's a meaningless word unless you know some back story that I clearly don't?
I would love an explanation as it looks to me like an area of confusion for people new to writing middleware.
Type safety, IDE type hinting.
A callable can be anything, an interface guarantees parameter types and, in PHP 7, return types.
Interfaces also indicate explicit implementation of the standard - rather than implicit implementation on the basis that the passed parameter could be executed.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/84259821-f77f-4273-bdb7-b5f222629e62%40googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/php-fig/V12AAcT_SxE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAAwdEzD4061LBOxQju4%3DGUjLuUgXsbnKu0e0jHBep4andR515g%40mail.gmail.com.
so I wonder why we aren't using __invoke in that interface too
That's a very good idea, it might be a good middle ground:
interface Next
{
public function __invoke(ServerRequestInterface $request) : ResponseInterface;
}
so I wonder why we aren't using __invoke in that interface tooThat's a very good idea, it might be a good middle ground:
interface Next
{
public function __invoke(ServerRequestInterface $request) : ResponseInterface;
}
I believe the argument MWOP made in the past is that many existing middleware systems already use __invoke(), so PSR-15 using __invoke() as well would make bridge code harder. A separate method makes having an object that just calls the method from an existing __invoke() (or vice versa) trivial.
Right but that applies to middlewares.
$next on the other hand is a throwable object/callable that wraps the next middleware because the next middleware expect another $next passed as parameter (at least from the implementations I've seen or implemented myself), so there shouldn't be any conflicts right?
I'm comfortable with this approach.
I see no reason to use __invoke for middleware. The spec requires a formal interface be used.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/4359293e-a51a-4225-96bf-addf4e056699%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+unsubscribe@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/c025e5d9-991b-43b5-af97-3bb7df023870%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAAqcDMjHWYx9Udft0uUj6EC9zbOr5d8E2vQFEgxEe5FAomF5ng%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAGOJM6JeTo3X%3Da1oQnVv-mLjJVOoNGQW_DRJ6%3DQxinX-_HXCaw%40mail.gmail.com.
Hi,
In the proposed PSR-15, there's a FrameInterface.
Where did the word "Frame" come from and in what context is it used. It means nothing to me and I don't think I'm alone in having no clue how I would be able to infer that $frame might have a next() method. It's very weird and I think it's a negative when looking at the function signature as it's a meaningless word unless you know some back story that I clearly don't?
I would love an explanation as it looks to me like an area of confusion for people new to writing middleware.
For what it's worth, I don't especially mind the interface itself, though I'm not sure what it adds other than more typing. It's the choice of name that I'm questioning.
Regards,
Rob...
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/8ea2fb90-2d69-484c-9b53-bec40722a17b%40googlegroups.com.
interface MiddlewareStackInterface
{
public function handle(RequestInterface $request) : ResponseInterface;
}
interface MiddlewareInterface
{
public function process(ServerRequestInterface $request, MiddlewareStackInterface $stack): ResponseInterface
}
Michael CFIG Secretary
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/c025e5d9-991b-43b5-af97-3bb7df023870%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+unsubscribe@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/18cb539f-b304-49c1-8a9f-58a41cf0fd25%40googlegroups.com.