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

PHP 8 support #35

Merged
merged 18 commits into from
Oct 31, 2020
Merged

PHP 8 support #35

merged 18 commits into from
Oct 31, 2020

Conversation

rieschl
Copy link
Contributor

@rieschl rieschl commented Oct 22, 2020

Q A
Documentation no
Bugfix no
BC Break no
New Feature yes
RFC no
QA yes

Description

  • The minimum PHP version was bumped to 7.3, PHPUnit updated to 9.3 and all related problems fixed.
  • Also, return types were added for test methods and static invocation in assert calls.
  • Travis now checks PHP 7.3, 7.4 and 8.0.
    • Code style checks (phpcs) are done in PHP 7.3 because codesniffer v2 throws some deprecation warnings in 7.4. Upgrading to the latest laminas-coding-standard will probably fix that.
    • In nightly/PHP8 mongodb is disabled because the extension doesn't support PHP8, yet.
  • I also added a test for Validator\HttpUserAgent

ToDo:

  • drop laminas-servicemanager v2 support
  • drop laminas-eventmanager v2 support(?)
  • remove tests that rely on PHP 7.1 (and are therefore skipped in all builds)
  • add some more tests: I'd like to add some more tests, after dropping support for the old laminas-packages

@boesing Could you confirm that the todo list is ok?

fixes #33
required for #30

* update phpunit.xml schema
* fix deprecated/removed/changed stuff in PHPUnit 9

Signed-off-by: Thomas Rieschl <thomas@trinet.at>
Signed-off-by: Thomas Rieschl <thomas@trinet.at>
Signed-off-by: Thomas Rieschl <thomas@trinet.at>
Signed-off-by: Thomas Rieschl <thomas@trinet.at>
Signed-off-by: Thomas Rieschl <thomas@trinet.at>
…db in php8

Signed-off-by: Thomas Rieschl <thomas@trinet.at>
Signed-off-by: Thomas Rieschl <thomas@trinet.at>
Signed-off-by: Thomas Rieschl <thomas@trinet.at>
Copy link
Member

@boesing boesing left a comment

Choose a reason for hiding this comment

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

So far, LGTM.
Had some minor change requests but overall, nice improvement here 👍

composer.json Outdated Show resolved Hide resolved
test/ReflectionUtil.php Outdated Show resolved Hide resolved
test/ReflectionUtil.php Outdated Show resolved Hide resolved
@boesing boesing added this to In progress in PHP 8.0 via automation Oct 22, 2020
@boesing boesing added Enhancement hacktoberfest-accepted Issues/Pull-Requests which can be fixed during Hacktoberfest: https://hacktoberfest.digitalocean.com labels Oct 22, 2020
@boesing
Copy link
Member

boesing commented Oct 22, 2020

remove tests that rely on PHP 7.1 (and are therefore skipped in all builds)

Do you have examples? I am not into this repo (I've justed added 300 Issues for all packages ;-)) so I'd prefer having some examples. Overall: yes, remove 'em if they're really 7.1 related.

add some more tests: I'd like to add some more tests, after dropping support for the old laminas-packages

Would prefer a dedicated PR for improvements.

drop laminas-servicemanager v2 support
drop laminas-eventmanager v2 support(?)

I'll give you feedback ASAP.
Update: Yes! drop it like its hot! 👍

@Ocramius
Copy link
Member

Removing old major versions of deps is fine, as long as it doesn't change our API 👍

…quirement in composer.json

Signed-off-by: Thomas Rieschl <thomas@trinet.at>
…hould also cover AbstractContainer

Signed-off-by: Thomas Rieschl <thomas@trinet.at>
@rieschl
Copy link
Contributor Author

rieschl commented Oct 22, 2020

remove tests that rely on PHP 7.1 (and are therefore skipped in all builds)

Do you have examples? I am not into this repo (I've justed added 300 Issues for all packages ;-)) so I'd prefer having some examples. Overall: yes, remove 'em if they're really 7.1 related.

Yes, there are some tests which are skipped if PHP is less than 7.1 in IdTest, SessionConfigTest and StandardConfigTest

add some more tests: I'd like to add some more tests, after dropping support for the old laminas-packages

Would prefer a dedicated PR for improvements.

Yes, just a few to keep coveralls from failing :)

…ager v2

Signed-off-by: Thomas Rieschl <thomas@trinet.at>
@boesing
Copy link
Member

boesing commented Oct 22, 2020

Yes, just a few to keep coveralls from failing :)

This PR will get merged even without increasing coveralls. Just decreasing wont be that good ;-)

@rieschl
Copy link
Contributor Author

rieschl commented Oct 22, 2020

Yes, just a few to keep coveralls from failing :)

This PR will get merged even without increasing coveralls. Just decreasing wont be that good ;-)

But apparently, coveralls thinks it decreased and marks the build as failed 🤷
But hopefully, the latest commit will do 🙂

Signed-off-by: Thomas Rieschl <thomas@trinet.at>
Signed-off-by: Thomas Rieschl <thomas@trinet.at>
@rieschl rieschl marked this pull request as ready for review October 23, 2020 07:27
@rieschl rieschl requested a review from boesing October 23, 2020 07:27
@rieschl
Copy link
Contributor Author

rieschl commented Oct 23, 2020

Alright, I think I'm satisfied with my PR, now. However, coveralls still complains and I have no idea, why. If anyone can point me to the right direction, I'm happy to add another test.

@boesing
Copy link
Member

boesing commented Oct 23, 2020

However, coveralls still complains and I have no idea, why.

With the transition to laminas, we've added minimum of coverage which is not reached in this and many other projects. Thus, we are merging those projects even if coveralls is complaining. Thats what I wanted to say in one of my latest messages.

This is already a huge improvement you did here, thank you very much, @rieschl

I'll start review later on, but one thing I've already realized is the deletion of some files.
Even if we dropped support for EventManager v2, dropping source code is a BC break.
So either we find a way to keep those files and internally use the v3 event manager or we have to create a new major.
I'd prefer not bumping this to a new major. 😅

@rieschl
Copy link
Contributor Author

rieschl commented Oct 23, 2020

I'll start review later on, but one thing I've already realized is the deletion of some files.
Even if we dropped support for EventManager v2, dropping source code is a BC break.
So either we find a way to keep those files and internally use the v3 event manager or we have to create a new major.
I'd prefer not bumping this to a new major. 😅

Hm, I can just keep the files, but then there's really no reason to drop eventmanger v2? I could throw an Exception, if AbstractValidatorChainEM2 would be loaded?
Or just keep the files but only remove the logic in the ValidatorChain?

@rieschl
Copy link
Contributor Author

rieschl commented Oct 23, 2020

I'll start review later on, but one thing I've already realized is the deletion of some files.
Even if we dropped support for EventManager v2, dropping source code is a BC break.
So either we find a way to keep those files and internally use the v3 event manager or we have to create a new major.
I'd prefer not bumping this to a new major. 😅

Hm, I can just keep the files, but then there's really no reason to drop eventmanger v2? I could throw an Exception, if AbstractValidatorChainEM2 would be loaded?
Or just keep the files but only remove the logic in the ValidatorChain?

I reverted the deletion of those files, but kept the new/changed ValidatorChain. Is this how you meant it?

@boesing
Copy link
Member

boesing commented Oct 31, 2020

Damn, my fault.
After reviewing this PR locally, I think its fine to drop v2 compat ValidatorChain.
I should spend more time in reviewing PRs while checking the code out.

Sorry for the trouble.

@rieschl
Copy link
Contributor Author

rieschl commented Oct 31, 2020

Damn, my fault.
After reviewing this PR locally, I think its fine to drop v2 compat ValidatorChain.
I should spend more time in reviewing PRs while checking the code out.

Sorry for the trouble.

Thanks for the feedback!
I removed the latest commit (which re-added the previously deleted files), so the files are gone, now.

@rieschl
Copy link
Contributor Author

rieschl commented Oct 31, 2020

I just found another thing. In SessionConfig there are setHashFunction and setHashBitsPerCharacter, and in StandardConfig even more PHP 7.1 specific stuff.
Now that PHP7.1 is dropped, should I make a no-op there? Removing the methods is a BC break, right? Or just mark it as deprecated, throw an Exception?
Thanks!

@boesing
Copy link
Member

boesing commented Oct 31, 2020

Just mark the methods as deprecated but keep them as is.
When marked as deprecated, we can drop these functions in the next major and are good to go. 👍

…d in PHP 7.1

Signed-off-by: Thomas Rieschl <thomas@trinet.at>
@rieschl
Copy link
Contributor Author

rieschl commented Oct 31, 2020

Just mark the methods as deprecated but keep them as is.
When marked as deprecated, we can drop these functions in the next major and are good to go. 👍

Done!

PHP 8.0 automation moved this from In progress to Reviewer approved Oct 31, 2020
Copy link
Member

@boesing boesing left a comment

Choose a reason for hiding this comment

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

LGTM

@boesing boesing added this to the 2.10.0 milestone Oct 31, 2020
Signed-off-by: Thomas Rieschl <thomas@trinet.at>
Signed-off-by: Thomas Rieschl <thomas@trinet.at>
@boesing
Copy link
Member

boesing commented Oct 31, 2020

@froschdesign As the functionality of some methods in StandardConfig was removed with PHP 7.1 (and we dropped 7.1), should we remove the parameters from documentation aswell or should we just mark them as deprecated in the documentation aswell?

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
@boesing boesing merged commit 990a9d1 into laminas:2.10.x Oct 31, 2020
PHP 8.0 automation moved this from Reviewer approved to Done Oct 31, 2020
@boesing
Copy link
Member

boesing commented Oct 31, 2020

Thanks, @rieschl!

@froschdesign
Copy link
Member

@boesing

…should we just mark them as deprecated in the documentation aswell?

Has already been done in the past. See: https://docs.laminas.dev/laminas-session/config/#basic-configuration-options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement hacktoberfest-accepted Issues/Pull-Requests which can be fixed during Hacktoberfest: https://hacktoberfest.digitalocean.com
Projects
No open projects
PHP 8.0
  
Done
Development

Successfully merging this pull request may close these issues.

PHP 8.0 support
4 participants