Skip to content

Code standards updated to PHP 7.3#9

Merged
TavoNiievez merged 2 commits intoCodeception:masterfrom
TavoNiievez:return-types
May 27, 2021
Merged

Code standards updated to PHP 7.3#9
TavoNiievez merged 2 commits intoCodeception:masterfrom
TavoNiievez:return-types

Conversation

@TavoNiievez
Copy link
Copy Markdown
Member

@TavoNiievez TavoNiievez commented May 12, 2021

  • The minimum version of PHP is now 7.3
  • Added strict types
  • Added return types
  • Removed unnecessary qualifiers
  • Removed support for Mezzio 2

@TavoNiievez TavoNiievez marked this pull request as ready for review May 13, 2021 02:47
@TavoNiievez TavoNiievez requested a review from Naktibalda May 13, 2021 02:47
composer.json Outdated
],
"minimum-stability": "RC",
"require": {
"php": "^7.1 || ^8.0",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank for taking this chance: since we require mezzio:v3 we can bump this even further to match it (https://github.com/mezzio/mezzio/blob/f2643cac71621ff7dcf56091214f6cd14deaaf6c/composer.json#L33), so "php": "^7.3 || ^8.0"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even better :-)
I didn't do it right away because I promised to update a lot of modules, and in some cases going from PHP 5.6 to PHP 7.3 requires a lot of effort and time.

* @throws Exception
*/
public function doRequest($request)
public function doRequest($request): Response
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love this, but it's a BC Break with little advantage over the already present DocBlock.
So please leave public and protected methods as is, and only update private ones.

Copy link
Copy Markdown
Member Author

@TavoNiievez TavoNiievez May 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Slamdunk I undid this specific change, since doRequest comes from here and there are no return types there yet.

Nevertheless, Adding return types is really what is motivating me to submit this PR. If you look at this thread you will understand why this BC is intentional.

The idea is to release this as a major version of the module. In the case of Mezzio it would be 3.0.0, which is also consistent with the improvements included in Codeception 5.

@Slamdunk Slamdunk added the enhancement New feature or request label May 13, 2021
@TavoNiievez TavoNiievez requested a review from Slamdunk May 13, 2021 12:27
@TavoNiievez TavoNiievez changed the title Code standards updated to PHP 7.1 Code standards updated to PHP 7.3 May 13, 2021
@TavoNiievez TavoNiievez merged commit f016ebe into Codeception:master May 27, 2021
@TavoNiievez TavoNiievez deleted the return-types branch May 27, 2021 21:13
@TavoNiievez TavoNiievez added this to the 3.0.0 milestone Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants