public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next) : ResponseInterface
{
}
public function __invoke(ServerRequest $request, Response $response, callable $next) : Response
{
}
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/ea157c85-77b0-4fd4-a945-087ff1970a6c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks for putting this together Mathieu. +1
--
How do you propose to resolve this common problem?
namespace Zend\Diactoros;
use Psr\Http\Message\ServerRequestInterface;
class ServerRequest implements ServerRequestInterface { ... }
I disagree with removing the -Interface suffix.
Not so much that I think it has to be there, but more along the lines of if it isn't going to be there then the FIG should select a new, perhaps less verbose, naming convention instead.
I feel the suffix gives clarity and informs consumers/implementers that a type hint is dealing with an interface and not a concrete class.
Thanks,
Jason
--
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/7eb5ba06-515a-41c3-bae7-9db47c41b5c4%40googlegroups.com.
To reiterate, this change would *not* affect finalized, approved PSRs at all. It is *explicitly* only for future PSRs.
For my part, I've always been annoyed by including the type of item in the name of the item itself (Interface, Trait, Controller, Model, etc), especially when the namespace already contains it. I understand it increases clarity in some cases for what contexts a given item can be used in, but if the namespace does that as well (and the PSR namespace certainly qualifies), it just feels redundant. But that's just my take on it.
--
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/84a1442f-9a5a-42e8-ae8e-5b8be2fb6ce0%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/84a1442f-9a5a-42e8-ae8e-5b8be2fb6ce0%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 view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAFjuE%2B%3D7eUG4i0jWguBUC3MYR1TbZsG-TdQsg_nacGYAd1bd1A%40mail.gmail.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/Potawlu2CrQ/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/eaae419c-b94e-49f9-a976-be05be3ece49%40googlegroups.com.
names are ridiculously long and hard to read.
I disagree with removing the -Interface suffix.
Not so much that I think it has to be there, but more along the lines of if it isn't going to be there then the FIG should select a new, perhaps less verbose, naming convention instead.
I feel the suffix gives clarity and informs consumers/implementers that a type hint is dealing with an interface and not a concrete class.
Thanks,
Jason
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
--
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/9f0676f2-f411-409b-ae6b-4906daa85bd4%40googlegroups.com.
Actually blogged a bit on it too: https://phpixie.com/blog/naming-interfaces-in-php.html#
Also Java is not doing it and it worked out for them just fine
It is not about being right or wrong really. Its more about being strict for no good reason. Its a backwards compatible change, so if you like you can still suffix your interfaces.
There is no more reason to force the suffix than there would be a reason to force an 'Abstract' prefix or whatever.
As the Bible goes: the law was invented for the people, not the people for the law
So if there are sufficient projects that are psr compatible but dont want the suffix, why not?
Things like tabs vs spaces are important so that the code looks the same, but an interface suffix dictates much more than just text formating of your code.
--
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/Potawlu2CrQ/unsubscribe.
To unsubscribe from this group and all its topics, 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/5df31985-b3ec-4298-9627-e0beb39725a2%40googlegroups.com.
It is not about being right or wrong really. Its more about being strict for no good reason. Its a backwards compatible change, so if you like you can still suffix your interfaces.
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next) : ResponseInterface
{
}
--
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/Potawlu2CrQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to php-fig+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAGOJM6KqQSZMykis%2B6676Toh7VyHL0byTTEgCPJ%2BFZioFawF7g%40mail.gmail.com.
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/84a1442f-9a5a-42e8-ae8e-5b8be2fb6ce0%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+u...@googlegroups.com.
Also, you wouldn't be allowed to have poor naming like Foo implements FooInterface. It looks like naming impotence: you have implementation, why you can't describe what makes this implementation specific: MySqlFoo? MemcachedFoo? ZendFoo?
Hi all,
This is a 2 weeks discussion before going to a vote.The "Interface" suffix has been questioned a few times already, I'm suggesting we put that up to a vote and avoid future debates. Here are relevant threads I could find on the topic:Suggested change: replace "MUST" to "MUST NOT" in "Interfaces MUST be suffixed by Interface" from http://www.php-fig.org/bylaws/psr-naming-conventions/I do not suggest accepted PSRs are changed.Please share your reasons to vote FOR or AGAINST the change, let's debate for 2 weeks or more, and then let's have a vote to settle this.Discussion will last for at least 2 weeks (20:40 UTC on 29 August 2016).---Here are my arguments to vote FOR the change:- the Interface suffix makes simple names very longFor example with PSR-7, here is the signature of a Slim/Zend Expressive middleware:
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next) : ResponseInterface{
}
Compare that to:public function __invoke(ServerRequest $request, Response $response, callable $next) : Response{
}
The last one is much simpler and clearer. Typing and reading the first one is a huge pain. This point applies of course to all PSRs, not just PSR-7.
- the Interface suffix makes the interface a detail and the implementation the main thing, it should be the other way aroundWe should care about the interface, not the implementation. Type-hinting against LoggerInterface means that "Logger" (the implementation) is still "the logger", and the interface is a secondary concept that we explicitly inject for decoupling.If "Logger" was the interface, it would be even more obvious that the interface is the most important part. The implementation is secondary and I don't even care how it's named. I just want a logger and that's what the interface is.
@Woody | It depends on what type of request it is. The implementation IMO could be called `HttpRequest`. But others may have internal and external requests.. eg. InternalRequest and ExternalRequest.
--
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/Potawlu2CrQ/unsubscribe.
To unsubscribe from this group and all its topics, 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/26e9735e-e9a8-4399-aa42-a56deb10298e%40googlegroups.com.
That's just replacing a suffix with a prefix. Zero sum game.
I have to concur with those who classify this akin to "tabs vs spaces", as:
- neither choice significantly hinders coding
- either choice could win a vote today and lose a revote in several months
I see this as one of those "pick one and be done, stick with it, and focus on harder stuff".
I understand the points being made by those who don't like the suffix. However, I see minimal benefit at best to reversing the original decision.
CRB
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/ea157c85-77b0-4fd4-a945-087ff1970a6c%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
On 19 Aug 2016, at 01:50, Chuck Burgess <demon...@gmail.com> wrote:I have to concur with those who classify this akin to "tabs vs spaces", as:
- neither choice significantly hinders coding
- either choice could win a vote today and lose a revote in several monthsI see this as one of those "pick one and be done, stick with it, and focus on harder stuff”.
I agree in so far that we need to acknowledge that there will be PSRs superseding previous PSRs and there will be PSRs that are incompatible to previous PSRs.
--
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/c6aaee8c-3c2f-dd0f-253f-bec5999c92a2%40garfieldtech.com.
--
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/8cef0c49-0ac2-4d71-a953-28b3cd2e2992%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/FF9DE8D1-BEDD-43A4-BB16-C3B31A4890B4%40buffalo.edu.
@Stefano> This is a non issue...This is important for a standard, others are adopting to what you do here - that's the definition of a standard. Coders sees and copies what you do and even use it as an argument when discussing the issue, it's natural for this discussion to show up in this forum. Solve the issue by it's root, so yes it is an issue...
--
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/Potawlu2CrQ/unsubscribe.
To unsubscribe from this group and all its topics, 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/CAFojS1snK-%3D9rzdUxDOgtogkbsYFUEp-90XcyRJk0U0P5VJ9Hw%40mail.gmail.com.
How do you propose to resolve this common problem?namespace Zend\Diactoros;use Psr\Http\Message\ServerRequestInterface;class ServerRequest implements ServerRequestInterface { ... }When the class name is the same as the interface name, you have to use aliases. The correct approach for the problem you put forward is:use Psr\Http\Message\ServerRequestInterface as ServerRequest;use Psr\Http\Message\ResponseInterface as Response;public function __invoke(ServerRequest $request, Response, callable $next) { ... }To wit, alias the interface in code that uses the interface if you find it annoying.I am strongly AGAINST this change as it results in churn for an a huge number of projects without adding any value.
--
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/ea157c85-77b0-4fd4-a945-087ff1970a6c%40googlegroups.com.
Ironically, I think this is disadvantage: you don't need to know about it.
Further, if you don't allow inheritance like this: final class Logger, you would be allowed to convert Logger into an interface without breaking BC.