Re: FIG-hosted enumerations

2021-05-24 Thread Alexandru Pătrănescu
On Mon, May 24, 2021 at 10:25 PM Michael C wrote: > I echo Jordi's thoughts and think doing enums once for easy, common and > uncontroversial enum sets makes sense but would steer away from anything > that could be hard to define a finite set for. We would also need to > consider a policy for cha

Re: [DISCUSS] Disallowing trailing comma in function and method definitions

2020-04-29 Thread Alexandru Pătrănescu
Hi, For me, trailing commas feature is surely useful and the main advantage for me is to have a smaller diff on code reviews. For TS this is the tslint rule I use: "trailing-comma": [true, {"multiline": "always", "singleline": "never"}], basically stating that if the list is multi line, it is e

Re: PSR-7: reuseful Request, how change body content?

2019-10-15 Thread Alexandru Pătrănescu
Hi Anton, > > *Not reusable/resettable objects it`s potential problem in future.**Yes, > we can send factories or add empty instances, but it's harder than add > method to reset content.* The pattern that PSR-7 promote is the use of immutable objects. It is maybe a bit harder to use, in some p

Re: [BYLAW] Proposal: let PSRs evolve with the language

2019-10-08 Thread Alexandru Pătrănescu
;s accepted types, is a BC due to the > same principle. > > Il giorno lunedì 7 ottobre 2019 13:22:26 UTC+2, Alexandru Pătrănescu ha > scritto: >> >> Hi George, Alessandro, >> >> I had this idea that this could be a minor version as well: >> https://twitt

Re: [BYLAW] Proposal: let PSRs evolve with the language

2019-10-07 Thread Alexandru Pătrănescu
Hi George, Alessandro, I had this idea that this could be a minor version as well: https://twitter.com/drealecs/status/1180258126215430150 but few minutes later realized that it's not going to work everywhere without BC break on the client side. If an interface was designed to accept a specific p

Re: [BYLAW] Proposal: let PSRs evolve with the language

2019-10-04 Thread Alexandru Pătrănescu
1:23:58 UTC+2, Adrien Crivelli ha > scritto: >> >> >> On Thursday, 19 September 2019 00:27:09 UTC-7, Alexandru Pătrănescu wrote: >>> >>> we would want to allow upgrading major version of slim without upgrading >>> to a major version of guzzle. >>&g

Re: [BYLAW] Proposal: let PSRs evolve with the language

2019-09-19 Thread Alexandru Pătrănescu
at the > same time. > > чт, 19 сент. 2019 г., 8:35 Alexandru Pătrănescu : > >> I apologize if my answer didn't provide clearer cases where this solution >> that seems to be the simplest one is just not working: >> >> - If I have a small project where I use sli

Re: [BYLAW] Proposal: let PSRs evolve with the language

2019-09-18 Thread Alexandru Pătrănescu
I apologize if my answer didn't provide clearer cases where this solution that seems to be the simplest one is just not working: - If I have a small project where I use slim framework and guzzle http client, both having implementation of PSR-7, I should be allowed to upgrade each one to another ma

Re: [BYLAW] Proposal: let PSRs evolve with the language

2019-09-18 Thread Alexandru Pătrănescu
Hi Cees-Jan, guys, Well, there is a difference here that maybe should be articulated a bit more clearly. PSRs that are problematic in terms of evolution and in discussion here are most of the time declaring interfaces. That means that for them the dependent packages are coupled with PSR package b

Re: PSR-12 "closing brace of control structure" clarification

2019-04-14 Thread Alexandru Pătrănescu
Hi Alexey, And to answer your second question, the example with extra new lines before closing brace makes the code less readable, for me at least. As you might think, how easy is to read a text is different from person to person and when this format was decided long time ago, multiple already wr

Re: PSR-7 URI Interface userInfo question

2019-03-18 Thread Alexandru Pătrănescu
> > public function setUser() > { > return $this->user; > } > > Problem with the current set of methods is that I am unable to get the > password out of Uri without doing string 'hackery' outside of the spec of > this interface. > > Hence me suggesting one sh

Re: PSR-7 URI Interface userInfo question

2019-03-18 Thread Alexandru Pătrănescu
Hi Rob, In UriInterface there is this method: public function withUserInfo($user, $password = null): UriInterface; https://github.com/php-fig/http-message/blob/master/src/UriInterface.php#L207 I guess this is what you want. Regards Alex On Mon, Mar 18, 2019 at 3:37 PM Robert Crous wrote: >

Re: [REVIEW] PSR-14 Event Dispatcher

2019-02-23 Thread Alexandru Pătrănescu
Hi working group, I spent some time reviewing the specs. I don't see any major issues but I have few items to discuss/improve: 1. Listeners. Phrase: *A Listener MAY delegate actions to other code. That includes a Listener being a thin wrapper around retrieving an object from a service container

Re: PSR-19 Prevent PHPDoc inheritance

2018-11-26 Thread Alexandru Pătrănescu
A RemoteStringLoader implementation that will fetch the string from a remote location and then use StringLoader by composition. Alex On Mon, Nov 26, 2018 at 3:57 PM Woody Gilk wrote: > On Mon, Nov 26, 2018 at 6:56 AM Marcos Passos > wrote: > >> Think about a loader interface, that can throw a

Re: PSR-19 Prevent PHPDoc inheritance

2018-11-26 Thread Alexandru Pătrănescu
Hi, I think it's a valid point of view. Simple example I can think of is that develop might want to use reuse the simple implementation that never fails instead of the interface in a private method/class. And he knows that it will not fail so it should not be hinted by editor to handle the except

Re: [PSR-17] ResponseFactoryInterface

2018-11-11 Thread Alexandru Pătrănescu
Hi, In terms of packages, I can't see a reason not to have a version 1.1.0 to php-fig/http-message that will add more methods to Psr\Http\Message\ MessageInterface I guess this can be achieved by another PSR, superseding PSR-7 in a backward compatible way. Also, I was looking at withHeader and

Re: [PSR-11] Review: should the container ALWAYS return the same instance?

2016-11-08 Thread Alexandru Pătrănescu
Hi Pedro, You articulated your problem well. Thanks. If you have a need to use a container so that it must return a shared or new instance than using the PSR-11 interface directly is not a solution. Just as everyone said, PSR-11 is not addressing this problem. I said this another time in another

Re: [PSR-15] FrameInterface

2016-08-15 Thread Alexandru Pătrănescu
> > I'm comfortable with this approach. > Great. But *MiddlewareInterface* is using *process* instead of *__invoke*. Should we settle on one approach for both? Alex On Sunday, August 14, 2016 at 9:20:22 PM UTC+3, Woody Gilk wrote: > > On Sun, Aug 14, 2016 at 12:32 PM, Matthieu Napoli > wro

Re: [PSR-15] Why StackInterface? And why is it not a middleware?

2016-08-15 Thread Alexandru Pătrănescu
+1 for removal. There is really no reason to have it. The methods for creating the stack are not going to be used against the interface because each library will have it's own way of using it's implementation. What remains is the process method that I think is also in the same position: you kno

Re: [PSR-13] "With-er" methods

2016-08-01 Thread Alexandru Pătrănescu
Hi all, Just like along with *get* *is* is also a *getter*, the same way *with* is also a *setter*. If you really want to distinguish it, it is a *fluent setter*. Using *with* methods has nothing to do with the object being immutable and does not enforce that the method will return a new instance

Re: [PSR-15] FrameInterface

2016-07-29 Thread Alexandru Pătrănescu
I think it can be both. - A FrameInterface to be used when developing middleware. - A CallableFrame class that's wrapping the callable if you really want to call it in a simple way. Maybe sometimes it's worth to have a very simple final class also in the PSR along with interfaces. For middleware

Re: A different approach to middleware

2016-06-21 Thread Alexandru Pătrănescu
Guys, it's all about the flow control and how to handle it while keeping as many things in the stack and not as state on middleware. For controlling the flow, we have this two approaches, first being the one intended and the second being more or less the one Alessandro propose. class Middleware