PHPUnit_Html icon indicating copy to clipboard operation
PHPUnit_Html copied to clipboard

Call to undefined method PHP_CodeCoverage_Filter::getInstance()

Open maximehardy opened this issue 12 years ago • 4 comments

Hi,

Using PHPUnit 3.6.10 and PHP_CodeCoverage 1.1.2, I was getting the following error when accessing the index.php page : PHP Fatal error: Call to undefined method PHP_CodeCoverage_Filter::getInstance() in /var/www/vendor/PHPUnit_Html/src/main.php on line 134

I solved easily the problem by replacing the line 134 of main.php which currently is : $filter = PHP_CodeCoverage_Filter::getInstance(); by : $filter = new PHP_CodeCoverage_Filter();

According to the code I found on the repository of PHP_CodeCoverage, this class is not a singleton anymore, which may explain the bug.

Maxime

maximehardy avatar Apr 13 '12 14:04 maximehardy

That's a perfect solution, thanks !

dumindarw avatar Mar 15 '14 18:03 dumindarw

Hello, I try to use PHPUnit 6.3.1 and PHP 7.1.5 (cli) and I have the same problem. I found a class Filter in /phpunit/php-code-coverage/src/Filter.php but I cannot use it. Please help me

joel-depiltech avatar Sep 25 '17 15:09 joel-depiltech

Hi, The code has not been tested with those versions. I will be updating it to PHP 7 later this year.

From: Joël Gaujard [mailto:[email protected]] Sent: 25 September 2017 16:34 To: nickturner/PHPUnit_Html [email protected] Cc: Subscribed [email protected] Subject: Re: [nickturner/PHPUnit_Html] Call to undefined method PHP_CodeCoverage_Filter::getInstance() (#2)

Hello, I try to use PHPUnit 6.3.1 and PHP 7.1.5 (cli) and I have the same problem. I found a class Filter in /phpunit/php-code-coverage/src/Filter.php but I cannot use it. Please help me

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nickturner/PHPUnit_Html/issues/2#issuecomment-331919924 , or mute the thread https://github.com/notifications/unsubscribe-auth/AAzFpoNx714ku1tRtSULkCuE9O8dzQy1ks5sl8f7gaJpZM4Bp9Lt . https://github.com/notifications/beacon/AAzFpiQTO4021KHMT2vrbn6PSpiDOLtUks5sl8f7gaJpZM4Bp9Lt.gif

nickturner avatar Sep 25 '17 17:09 nickturner

Thanks for your answer ! I will watch this repository If you need some help you can ask, it will be a pleasure for me.

Regards, Joël

Le 25 sept. 2017 à 19:10, Nick Turner [email protected] a écrit :

Hi, The code has not been tested with those versions. I will be updating it to PHP 7 later this year.

From: Joël Gaujard [mailto:[email protected]] Sent: 25 September 2017 16:34 To: nickturner/PHPUnit_Html [email protected] Cc: Subscribed [email protected] Subject: Re: [nickturner/PHPUnit_Html] Call to undefined method PHP_CodeCoverage_Filter::getInstance() (#2)

Hello, I try to use PHPUnit 6.3.1 and PHP 7.1.5 (cli) and I have the same problem. I found a class Filter in /phpunit/php-code-coverage/src/Filter.php but I cannot use it. Please help me

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nickturner/PHPUnit_Html/issues/2#issuecomment-331919924 , or mute the thread https://github.com/notifications/unsubscribe-auth/AAzFpoNx714ku1tRtSULkCuE9O8dzQy1ks5sl8f7gaJpZM4Bp9Lt . https://github.com/notifications/beacon/AAzFpiQTO4021KHMT2vrbn6PSpiDOLtUks5sl8f7gaJpZM4Bp9Lt.gif

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nickturner/PHPUnit_Html/issues/2#issuecomment-331948536, or mute the thread https://github.com/notifications/unsubscribe-auth/AOa4G4S7tn9_-M9vqVUZza1Goxwg5VCvks5sl96XgaJpZM4Bp9Lt.

joel-depiltech avatar Sep 26 '17 08:09 joel-depiltech