Skip to content
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

Proposal: Drop support for PHP versions that are EOL #161

Closed

Conversation

tux-rampage
Copy link

All PHP versions < 7.2 are end of life and should no longer be used. It is harmful to support these outdated versions in the future.

Why?

  • PHPUnit cannot be upgraded to 8 and above
  • Newer language features cannot be adopted resulting in bloated or less readable code
  • Users should not be encouraged to build technical debt

Copy link
Contributor

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

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

Yes please \o/

@zerkms
Copy link
Contributor

zerkms commented Jun 26, 2020

Would this PR also add native typing to the Assert class as well then?

@orklah
Copy link

orklah commented Jun 27, 2020

Would this PR also add native typing to the Assert class as well then?

Seems complicated in most assertions. For example, if Assert::string can only takes string, it defeats its whole purpose (taking something else and fail the assertion).

@zerkms
Copy link
Contributor

zerkms commented Jun 27, 2020

@orklah I only meant those that can be typed: eg

     * @param mixed  $value
     * @param string $message

$message can be typed as string everywhere.

So, only places where @param at this very moment has non-mixed type (while I think that first argument should be mixed everywhere, but this would be a breaking change).

@Ocramius
Copy link
Contributor

don't think we should have mixed everywhere, especially due to purity and PHP magic 😞

But yes, where we have type declarations, we can now have native type checks.

Please remember to not accept Stringable BTW 😅

@zerkms
Copy link
Contributor

zerkms commented Jun 27, 2020

don't think we should have mixed everywhere, especially due to purity and PHP magic

I thought that too, but having alnum with string parameter requires you to first assert for string. It bloats code for no reason.

@Ocramius
Copy link
Contributor

Depends: I use that kind of assertion mostly where strings are already the current type, and maybe they are even already ensured to be not empty 🤷‍♀️

Even then, adding more precise assertions is powerful, and we probably want a DSL for grouping them together instead.

@zerkms
Copy link
Contributor

zerkms commented Jun 27, 2020

and we probably want a DSL for grouping them together instead.

oh nononononononononononononononononononononononononononononononononononononononononononononononononononononono

But anyway, you people enjoy your Saturday :-D

@Ocramius
Copy link
Contributor

Well, you know that beberlei/assert has lazy composable assertions: I really wonder if we could port assertion composition into types, and therefore teach it to psalm 💪

@ptondereau
Copy link

ptondereau commented Oct 19, 2020

It could be useful to also update phpunit version (^9.3) to have a full support a php 8 without ignoring platform requirements

@Nyholm
Copy link
Contributor

Nyholm commented Jan 18, 2021

Thank you. This suggestion has been merged into master.

I did not merge this PR because most of it changes/all had conflicts or were obsolete. I hope you don't mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants