[WG][VOTE] PSR-17 Review

209 views
Skip to first unread message

Matthew Weier O'Phinney

unread,
May 15, 2018, 12:06:02 PM5/15/18
to php...@googlegroups.com
Woody has delegated to me to open a vote to enter the REVIEW period for
PSR-17. This vote is open only to PSR-17 Working Group members; at this
time, that means:

- Woody Gilk (Editor)
- myself (Sponsor)
- Stefano Torresi
- Matthieu Napoli
- Korvin Szanto
- Glenn Eggleton
- Oscar Otero
- Tobias Nyholm

The by-laws do not stipulate a time-frame for how long the vote must
run, though 2 weeks is the standard period. As such, the vote will run
until 23:59:59 on 29 May 2018, or until all members have responded. Once
the vote is closed, I
will post the results, and indicate next steps for the proposal.

PLEASE DO NOT RESPOND TO THIS POST UNLESS YOU ARE ONE OF THE MEMBERS
LISTED ABOVE.

--
Matthew Weier O'Phinney
mweiero...@gmail.com
https://mwop.net/

Matthew Weier O'Phinney

unread,
May 15, 2018, 12:06:35 PM5/15/18
to php...@googlegroups.com
+1 from me, clearly.

Korvin Szanto

unread,
May 15, 2018, 12:15:52 PM5/15/18
to PHP Framework Interoperability Group
+1

Woody Gilk

unread,
May 15, 2018, 12:31:49 PM5/15/18
to PHP Framework Interoperability Group
Thank you, Matthew

+1

Oscar Otero

unread,
May 15, 2018, 1:05:29 PM5/15/18
to php...@googlegroups.com
+1

-- 
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/fe2c196f-31d4-4bc8-bd0b-f44410c48fad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stefano Torresi

unread,
May 15, 2018, 3:50:22 PM5/15/18
to php...@googlegroups.com

Matthieu Napoli

unread,
May 16, 2018, 2:57:07 AM5/16/18
to PHP Framework Interoperability Group
+1

Glenn Eggleton

unread,
May 17, 2018, 10:52:17 AM5/17/18
to PHP Framework Interoperability Group
+1

Tobias Nyholm

unread,
May 19, 2018, 3:01:21 AM5/19/18
to PHP Framework Interoperability Group
I really like the work you've put in and I'm sorry I'm late replying here.
As you may or may not know, I'm maintaining Buzz, HTTPlug (and sometimes Guzzle). I've also written a PSR7 implementation with factories from HTTPlug and php-interop. (https://github.com/nyholm/psr7)

I've just read and tested(!!) the specification we are voting on. I'm not sure it works to be honest. Here are a few things I found:

Namespace (minor): Should we really share the namespace with PSR7? Just use 'Psr\Http\MessageFactory'

Interfaces extending (critical): I've read the arguments on the meta document. The four bullets (https://github.com/php-fig/fig-standards/blob/master/proposed/http-factory/http-factory-meta.md#53-why-do-some-interfaces-extend-others) are all very true but none is an argument for the interface to extend each other.

The first bullet about this in the meta document says:
> The RequestFactoryInterface and ServerRequestFactoryInterface may each need to build a UriInterface from a string URI.

Inheritance is not the answer here. Please use a constructor to inject the dependencies (or if you are lazy, do like me https://github.com/Nyholm/psr7/blob/0.3.0/src/Request.php#L58).
Consider a MailFactoryInterface. The mail factory implementation may need an EmailValidator. Should the MailFactoryInterface really extend EmailValidatorInterface?...

I found it very hard to write factory implementation with these interfaces. Most of my classes have to extend each other and I have to put the stream factory implementation in a Trait.

Existing libraries (major): HTTPlug has been an "de-facto" standard for almost 3 years now. The php-http/message-factory has been downloaded over 4M times. We (HTTPlug) like PSR-17 and we think it is about time PHP-Fig delivers a "real" standard for this. However, the current state of PSR-17 will not allow HTTPlug to extend PSR-17. It will also not allow implementing libraries (like guzzle/psr7 and nyholm/psr7) to have one RequestFactory for both PSR-17 and HTTPlug.

There is no mentioning about HTTPlug in the meta docs so I'm not sure it has been discussed. This is important for the adoption of the PSR-17.


-----------------

These are 3 of my concerns. I really hope that everybody in the working group have considered these 3 things before you voted. Or else there I believe there is a change to change your vote until the voting period is over or until everybody has voted.
 
I will give my vote on the 29th of May.

Stefano Torresi

unread,
May 21, 2018, 2:11:19 PM5/21/18
to php...@googlegroups.com
We had an interesting discussion on the WG Slack channel and, as far as I'm concerned, I got to share the design concerns raised by Tobias and shared by Woody.

As such, I'd like to change my vote to a -1, because I think the current draft can be made better by segregating the interfaces and avoiding the inheritance as suggested.

The main argument for shipping extended interfaces for [Request|Response]FactoryInterface is easier end-user consumption, i.e. fewer collaborators to depend on.
I ultimately think that, if such a purpose has to be attained, it should be done not at the expense of the simplicity of the overall design.

Possible alternatives would be including a couple of facade interfaces in the standard, in addition to simple ones, or a full fledged composite implementation in a *-utils package.

--
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.

Woody Gilk

unread,
May 21, 2018, 2:59:33 PM5/21/18
to PHP Framework Interoperability Group
For the reasons that Stefano just mentioned, I am also changing my vote:

-1
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/779dc60c-8b87-4245-8152-fc566e27b932%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.

To post to this group, send email to php...@googlegroups.com.

Matthew Weier O'Phinney

unread,
May 21, 2018, 5:46:36 PM5/21/18
to php...@googlegroups.com
I am going to end the vote at this point.

Based on discussions in the #PSR-14 FIG slack channel, it's clear that we
will need to make some changes to meet everyone's needs. As such, even if
we have the votes currently to go to review phase, we would likely need to
drop back to draft phase pretty quickly anyways.

I will call for a new vote once we have reached consensus.

Matthew Weier O'Phinney

unread,
May 23, 2018, 1:33:40 PM5/23/18
to php...@googlegroups.com
After some lengthy debate this past week, we've reverted the changes to the
spec that required inheritance in factories for classes that have
collaborators. We feel those can be achieved via "union type" interfaces or
a "SuperFactory" (combining all interfaces into a single instance) that we
can ship in a `-util` package. Either way, it is out of scope for the spec
itself.

As such, Woody has delegated to me once again to open a vote to enter the
REVIEW period for PSR-17. This vote is open only to PSR-17 Working Group
members; at this time, that means:

- Woody Gilk (Editor)
- myself (Sponsor)
- Stefano Torresi
- Matthieu Napoli
- Korvin Szanto
- Glenn Eggleton
- Oscar Otero
- Tobias Nyholm

The by-laws do not stipulate a time-frame for how long the vote must run,
though 2 weeks is the standard period. As such, the vote will run until
23:59:59 on 06 June 2018, or until all members have responded. Once the

Matthew Weier O'Phinney

unread,
May 23, 2018, 1:35:57 PM5/23/18
to php...@googlegroups.com
+1 from me.

Woody Gilk

unread,
May 23, 2018, 2:22:06 PM5/23/18
to PHP Framework Interoperability Group
+1
+1 from me.
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.

matt...@mnapoli.fr

unread,
May 23, 2018, 4:51:45 PM5/23/18
to PHP Framework Interoperability Group
+1

Matthieu
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/2EjKzE-7Yn8/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.

Oscar Otero

unread,
May 30, 2018, 4:32:58 PM5/30/18
to PHP Framework Interoperability Group
I undestand the reason of that change and, generally, am agree about simplify interfaces and respect the ISP.
But, in this case, I think the inheritage improves greatly the UX of the developers and makes the factory more useful.

After thinking about it a lot, I'm still undecided so my vote is +0

Stefano Torresi

unread,
Jun 1, 2018, 4:03:06 AM6/1/18
to php...@googlegroups.com
+1

--
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.

Tobias Nyholm

unread,
Jun 4, 2018, 11:28:31 AM6/4/18
to PHP Framework Interoperability Group
I would like to see a plan/upgrade path from HTTPlug's message factories before the PSR is final and published. But that should not stop us now.

Im +1. Great work!

Korvin Szanto

unread,
Jun 4, 2018, 2:14:42 PM6/4/18
to php...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages