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

ReflectionType::__toString() is deprecated in PHP 7.4 #3728

Closed
henryruhs opened this issue Jun 20, 2019 · 9 comments
Closed

ReflectionType::__toString() is deprecated in PHP 7.4 #3728

henryruhs opened this issue Jun 20, 2019 · 9 comments
Labels
status/waiting-for-feedback Waiting for feedback from original reporter

Comments

@henryruhs
Copy link

henryruhs commented Jun 20, 2019

Q A
PHPUnit version 8.1.3
PHP version 7.4snapshot
Installation Method Composer

Hello,

I have an issue on Travis CI using PHPUnit with convertWarningsToExceptions.

Function ReflectionType::__toString() is deprecated

It only happens in tests using getMockBuilder so this must be related to that the deprecation (since PHP 5.5.0) that now is throwing an warning: https://php.net/manual/de/reflectiontype.tostring.php

@henryruhs henryruhs changed the title PHP 7.4 warning ReflectionType::__toString() is deprecated ReflectionType::__toString() is deprecated in PHP 7.4 Jun 20, 2019
@sebastianbergmann
Copy link
Owner

PHPUnit 8.1.3 is no longer supported. Please try with PHPUnit 8.2.3, thanks.

@sebastianbergmann sebastianbergmann added the status/waiting-for-feedback Waiting for feedback from original reporter label Jun 21, 2019
@henryruhs
Copy link
Author

Awesome, I got it back working using the latest version. Thank you Sebastian...

@dereuromark
Copy link

dereuromark commented Aug 15, 2019

We have the same issue on PHPUnit 6.5, and the framework does not support > 6 here.
Is there a way to patch out the PHPUnit 6 series to be PHP7.4 compatible?

EDIT
To be precise: Part of the test harness is about PHP5.6 testing, as such the PHPUnit 6 series is needed here still.

@PabloKowalczyk
Copy link

@dereuromark i have similar issue in Crunz, here is how i solved it: create patched class (PHPUnit_Framework_MockObject_Generator), then use PHPUnit's bootstrap file to replace original class with patched one when PHP version is same or newer than 7.1. Whole PR for reference: lavary/crunz@8ef1370

@dereuromark
Copy link

Quite annoying to have to do that on like 30 repos etc though :/

@henryruhs
Copy link
Author

henryruhs commented Sep 28, 2019

I am sure that Sebastian does not give support for PHPUnit 6 to get PHP 7.4 running as he is very strict when it comes to end of life. 😆

Not a good idea to comment a closed issue aswell, open a fresh one with your description.

@PabloKowalczyk
Copy link

I am sure that Sebastian does not give support for PHPUnit 6

Actually I'm using PHPUnit 5.7, because I need PHP 5.6 support :)

@henryruhs
Copy link
Author

You cannot support both as new PHPUnit versions enforce return types for setup() and tearDown() ... so even with fancy CI that installes PHPUnit according to PHP version: this is a dead end!

  1. You can have 2 testing suites
  2. Rewrite testing suite files to PHP5 on the fly
  3. Finally, drop that old shit

samizdam added a commit to samizdam/route that referenced this issue Mar 13, 2020
tortuetorche added a commit to tortuetorche/laravel-notify that referenced this issue Nov 27, 2020
tortuetorche added a commit to tortuetorche/lern that referenced this issue Nov 27, 2020
tortuetorche added a commit to tortuetorche/monolog-mailgun that referenced this issue Nov 30, 2020
tylercd100 pushed a commit to tylercd100/laravel-notify that referenced this issue Dec 3, 2020
* update composer for Laravel 6.0.4

* update composer for Laravel ^6.0

* update composer for Laravel ^7.0

* Update composer.json to use Laravel 6, 7 and 8

* Update Travis CI config to use PHP >= 7.2

* Remove HipChat and Raven drivers because Monolog 2.0 removed them

* Laravel >= 8.0 doesn't support PHP 7.2

Update Travis CI config to ignore errors on PHP 7.2

* Tweak Travis CI config

To ignore errors only when testing with PHP 7.2 and Laravel 8

* Fix Travis CI config

To allow failures only when testing with PHP 7.2 and Laravel 8

* Clean Travis CI config

* Use 'next' branch for monolog-mailgun and monolog-sms

* Fix PHP 7.4 error with PHPUnit

See: sebastianbergmann/phpunit#3728

* PHP 8.0 support

* Add Sentry driver to replace Raven

Because RavenHandler was removed from Monolog since version 2.0

* Update CHANGELOG and README

* Fix Sentry driver

Fix commit fd624a1

* Run tests with PHP 8.0 on Travis CI

* Clean Composer file

Use the upcoming 'tylercd100/monolog-mailgun' 3.0.0 and
'tylercd100/monolog-sms' 2.0.0 versions

Co-authored-by: Robbie Love <Robbie@ubiquilife.com>
tylercd100 added a commit to tylercd100/lern that referenced this issue Dec 3, 2020
* update composer for Laravel 6.0.4

* update composer for Laravel ^6.0, raise minimum php version to 7.1

* update input facade to request

* fix Components/Notifier.php

* update composer.json for Laravel 7

* update composer.json for Laravel 7

* update Exception classes to Throwables

* more fixes but one part unsure (ddd())

* more fixes

* revert change in NotifierFailedException.php

* Support Laravel 6, 7 and 8

With PHP >= 7.2

* Clean Travis Ci config

* Use 'next' branch for laravel-notify

* Update README.md

To use Throwable instead of Exception for the report() method signature

* Fix PHP 7.4 error with PHPUnit

See: sebastianbergmann/phpunit#3728

* PHP 8.0 support

* Add Sentry driver to replace Raven

Because RavenHandler was removed from Monolog since version 2.0

* Update CHANGELOG and README

* Clean Composer file

Use the upcoming 'tylercd100/laravel-notify' 4.0.0 version

* Remove prefer lowest from travis

Co-authored-by: Robbie Love <Robbie@ubiquilife.com>
Co-authored-by: Tyler Arbon <tyler@arbonwebsolutions.com>
phansys added a commit to phansys/PhpZabbixApi that referenced this issue May 27, 2021
@dazimax
Copy link

dazimax commented Jun 9, 2021

PHPUnit 8.1.3 is no longer supported. Please try with PHPUnit 8.2.3, thanks.

@sebastianbergmann Could you please let me know what should be the compatible version of allure-framework/allure-phpunit when we upgrade to PHPUnit 8.2.3?

I am getting this error - allure-framework/allure-phpunit#40

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/waiting-for-feedback Waiting for feedback from original reporter
Projects
None yet
Development

No branches or pull requests

5 participants