-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds parameter typehints to ContainerInterface #27
Adds parameter typehints to ContainerInterface #27
Conversation
This patch bumps the minimum supported PHP version to 7.2 and adds parameter typehints to ContainerInterface, as the first step towards adding explicit typehints based on the specification. See https://www.php-fig.org/blog/2019/10/upgrading-psr-interfaces/
This patch will require creating a |
@weierophinney as I said on the ML, couldn't we release this as 1.1? (and #28 as 2.0) |
Ooops! My bad! I'll update the milestone and description to mention 1.1 here, and update #28 as well. |
Ping @moufmouf — are you okay with this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for moving this forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this brings no bc-break, it's a no-brainer to merge.
@moufmouf ok with this?
Does anyone know if there is any protocol that we need to follow before merging and tagging? I'm up to do it, but don't want to make any mistake.
Again, unlike #28 there's no bc break so I think this one can be done asap.
👍 I'm definitely ok with this. |
Maybe @Crell knows if we can merge this? |
@mnapoli @moufmouf the bylaw that you need to follow is this one: https://www.php-fig.org/bylaws/psr-evolution/ |
OK let's do this then, thanks a lot @Jean85 for clarifying this. |
I'll tag a release tomorrow, just to give a bit more notice. (can you tell I am afraid of messing something up? 😄) |
@mnapoli PLEASE DO NOT TAG 😓 we need to pass a vote: https://www.php-fig.org/bylaws/psr-evolution/#workflow
I'm happy to help you through this, but you need to collect all the work first: you already completed this PR, but we need to prepare (and not merge yet) #28 too, and prepare a PR for the bylaws that describe/includes all of this. Then we can call the vote, wait for the standard two weeks discussion time, and then have the vote itself. |
@Jean85 ha good call, thanks! OK so it seems @weierophinney did all the work already (I'm catching up with all repositories and the ML): php-fig/fig-standards#1215 So the next step is to notify the mailing list that there will be a vote in 2 weeks, is that correct? |
@mnapoli yes that's correct. I can handle that from there. |
@Jean85 thank you! |
@Jean85 Thanks - I dropped the ball on this, as I raised all of this right before the election cycle, and then forgot about it once elections were done. All we need is the discussion period + vote before we release, and when we do, we can do both releases in succession (1.1.0 and 2.0.0). |
This break existing code when implementation doesn't has scalar type-hint. Odd that the requirement just based on |
Looks like Mockery is doing something wrong. I think you need to create an issue in the Mockery page. |
The requirement is more than fine. End users will not install this newer version if they are not running at least 7.2; so they will still rely on the previous version, which is still on spec and compatible. The only way to break this is to
Nope, it's PHP < 7.2 that doesn't allow dropping arguments type and breaks the mock. |
Not a bug in Mockery. This only happens when you try to run the code on PHP older than 7.2.0. |
Unfortunately it's happening on php build 7.2, 7.3 and 7.4 https://travis-ci.org/github/orchestral/imagine/builds/751644184 |
Oh, this is because the illiminate interface does not have the typehint, and mockery is generating code to satisfy the new interface. |
Yeah, by https://3v4l.org/n8U4f logic when |
I think a 2.0 release would make the most sense too, actually, even if it is not considered "breaking" in all senses. Making it 2.0 makes everyone have to opt-in to upgrading. |
A 2.0 release would disrupt the initial plan about the PSR upgrade though? |
The general upgrade strategy specifically allows for 1.1/2.0 or a 2.0/3.0 transition, depending on the needs of particular specs. |
Isn't mocking the Illuminate interface the right choice there? |
This patch bumps the minimum supported PHP version to 7.2 and adds parameter typehints to ContainerInterface, as the first step towards adding explicit typehints based on the specification.
See https://www.php-fig.org/blog/2019/10/upgrading-psr-interfaces/