Why does code coverage report fail on php 7.2? - php

I'm running a php build matrix on travis-ci for php 7.0 and 7.2.
https://travis-ci.org/uawcob/course-overrides/jobs/242630482
On 7.0, The tests all pass and code coverage is generated fine.
On 7.2, you can see that all the tests run and pass the same, but generating the code coverage report throws an exception which causes the whole build to fail.
Why is this?
The full error stack for posterity:
Generating code coverage report in HTML format ...PHP Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable. in /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Container/Container.php:895
Stack trace:
#0 /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Container/Container.php(735): Illuminate\Container\Container->notInstantiable('Illuminate\\Cont...')
#1 /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\Container\Container->build('Illuminate\\Cont...')
#2 /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Container/Container.php(575): Illuminate\Container\Container->resolve('Illuminate\\Cont...')
#3 /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(728): Illuminate\Container\Container->make('Illuminate\\Cont...')
#4 /home/travis/build/uawcob/cour in /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 895
Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable. in /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 895
Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable. in /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 895
Call Stack:
3.7921 6622616 1. Illuminate\Foundation\Bootstrap\HandleExceptions->handleException() /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:0
3.7921 6622616 2. Illuminate\Foundation\Bootstrap\HandleExceptions->getExceptionHandler() /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:80
3.7921 6622616 3. Illuminate\Foundation\Application->make() /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:155
3.7921 6622616 4. Illuminate\Foundation\Application->make() /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:728
3.7921 6622616 5. Illuminate\Foundation\Application->resolve() /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Container/Container.php:575
3.7921 6622616 6. Illuminate\Foundation\Application->build() /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Container/Container.php:608
3.7921 6622728 7. Illuminate\Foundation\Application->notInstantiable() /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Container/Container.php:735
PHP Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable. in /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Container/Container.php:895
Stack trace:
#0 /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Container/Container.php(735): Illuminate\Container\Container->notInstantiable('Illuminate\\Cont...')
#1 /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\Container\Container->build('Illuminate\\Cont...')
#2 /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Container/Container.php(575): Illuminate\Container\Container->resolve('Illuminate\\Cont...')
#3 /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(728): Illuminate\Container\Container->make('Illuminate\\Cont...')
#4 /home/travis/build/uawcob/cour in /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 895
Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable. in /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 895
Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable. in /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 895
Call Stack:
3.7929 6633672 1. Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown() /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:0
3.7938 6641592 2. Illuminate\Foundation\Bootstrap\HandleExceptions->handleException() /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:119
3.7938 6641592 3. Illuminate\Foundation\Bootstrap\HandleExceptions->getExceptionHandler() /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:80
3.7938 6641592 4. Illuminate\Foundation\Application->make() /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:155
3.7938 6641592 5. Illuminate\Foundation\Application->make() /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:728
3.7938 6641592 6. Illuminate\Foundation\Application->resolve() /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Container/Container.php:575
3.7939 6641592 7. Illuminate\Foundation\Application->build() /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Container/Container.php:608
3.7939 6641704 8. Illuminate\Foundation\Application->notInstantiable() /home/travis/build/uawcob/course-overrides/vendor/laravel/framework/src/Illuminate/Container/Container.php:735

Looking into your code for that exact error message, the proposed fix upstream is to exclude the ./app/Http/routes.php file from code-coverage:
...
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./app</directory>
<exclude>
<file>./app/Http/routes.php</file>
<!-- ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ -->
...
That is from a quick look checking your projects sources of the build that fails shows that this is not yet set in the phpunit.xml.dist file. I can not say why this happens only in the PHP 7.2 build. So hopfully this can shed some more light and perhaps this rings a bell (e.g. different Phpunit version).

Related

Class 'WP_Session_Tokens' not found

After migration from Linux to Windows server there is on website fatal error in WordPress core. Debug log:
[22-Jul-2022 13:07:54 UTC] PHP Fatal error: Uncaught Error: Class 'WP_Session_Tokens' not found in D:\Sites\subdoms\test\wp-includes\class-wp-user-meta-session-tokens.php:17
Stack trace:
#0 D:\Sites\subdoms\test\wp-settings.php(188): require()
#1 D:\Sites\subdoms\test\wp-config.php(105): require_once('D:\\Sites\\web_98...')
#2 D:\Sites\subdoms\test\wp-load.php(50): require_once('D:\\Sites\\web_98...')
#3 D:\Sites\subdoms\test\wp-blog-header.php(13): require_once('D:\\Sites\\web_98...')
#4 D:\Sites\subdoms\test\index.php(17): require('D:\\Sites\\web_98...')
#5 {main}
thrown in D:\Sites\subdoms\test\wp-includes\class-wp-user-meta-session-tokens.php on line 17
Before migration was active W3 total cache. Could it be related?
I removed W3 total cache, class-wp-user-meta-session-tokens.php and other WordPress files seems correct.

Laravel throw console warning

I'm starting use laravel for a project. I've installed it like it's suggested on the official documentation, hovever, if I type laravel new projectname after I navigate to the macOS sites folder, It will give this errors
host:~ z$ laravel new kcms
Crafting application...
PHP Fatal error: Uncaught Error: Call to undefined method Symfony\Component\Process\Process::fromShellCommandline() in /Users/z/.composer/vendor/laravel/installer/src/NewCommand.php:84
Stack trace:
#0 /Users/z/.composer/vendor/symfony/console/Command/Command.php(255): Laravel\Installer\Console\NewCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /Users/z/.composer/vendor/symfony/console/Application.php(886): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /Users/z/.composer/vendor/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(Laravel\Installer\Console\NewCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /Users/z/.composer/vendor/symfony/console/Application.php(145): Symfony\Component\Console\Applicat in /Users/z/.composer/vendor/laravel/installer/src/NewCommand.php on line 84
Fatal error: Uncaught Error: Call to undefined method Symfony\Component\Process\Process::fromShellCommandline() in /Users/z/.composer/vendor/laravel/installer/src/NewCommand.php on line 84
Error: Call to undefined method Symfony\Component\Process\Process::fromShellCommandline() in /Users/z/.composer/vendor/laravel/installer/src/NewCommand.php on line 84
Call Stack:
0.0002 394608 1. {main}() /Users/z/.composer/vendor/laravel/installer/bin/laravel:0
0.0081 1414560 2. Symfony\Component\Console\Application->run() /Users/z/.composer/vendor/laravel/installer/bin/laravel:13
0.0202 1807648 3. Symfony\Component\Console\Application->doRun() /Users/z/.composer/vendor/symfony/console/Application.php:145
0.0203 1807648 4. Symfony\Component\Console\Application->doRunCommand() /Users/z/.composer/vendor/symfony/console/Application.php:262
0.0204 1807648 5. Laravel\Installer\Console\NewCommand->run() /Users/z/.composer/vendor/symfony/console/Application.php:886
0.0209 1812424 6. Laravel\Installer\Console\NewCommand->execute() /Users/z/.composer/vendor/symfony/console/Command/Command.php:255
what's wrong?
You will need to run the following command as the global version is not compatible or outgrade with the local one.
composer global update
or
composer global update laravel/installer

Joomla & PHP 7 : Fatal error: Argument 1 passed to JErrorPage::render()

Got the following error when I try to update a Joomla 3.9 website on a PHP7.2 environement.
Fatal error: Uncaught TypeError: Argument 1 passed to JErrorPage::render() must be an instance of Exception, instance of Error given in /var/www/xxxxx/libraries/cms/error/page.php:28 Stack trace: #0 [internal function]: JErrorPage::render(Object(Error)) #1 {main} thrown in /var/www/xxxxx/libraries/cms/error/page.php on line 28
Any idea what could cause this?
Website works fine on PHP 5.6 but I can't switch to PHP 7.2

Developing app in laravel 5.1 having reflection error, i am using Wamp server URL: http://localhost/laravel/public/.

I am migrating one table to database
C:\wamp\www\laravel>php artisan migrate
Fatal error: Uncaught exception 'ReflectionException' with message 'Class App\Co
nsole\Kernel does not exist' in C:\wamp\www\laravel\vendor\laravel\framework\src
\Illuminate\Container\Container.php on line 736
ReflectionException: Class App\Console\Kernel does not exist in C:\wamp\www\lara
vel\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 736
Call Stack:
0.0010 123768 1. {main}() C:\wamp\www\laravel\artisan:0
0.0380 1075752 2. Illuminate\Foundation\Application->make() C:\wamp\www
\laravel\artisan:31
0.0380 1075832 3. Illuminate\Container\Container->make() C:\wamp\www\la
ravel\vendor\laravel\framework\src\Illuminate\Foundation\Application.php:674
0.0380 1075832 4. Illuminate\Container\Container->build() C:\wamp\www\l
aravel\vendor\laravel\framework\src\Illuminate\Container\Container.php:626
0.0380 1075832 5. Illuminate\Container\Container->Illuminate\Container\
{closure}() C:\wamp\www\laravel\vendor\laravel\framework\src\Illuminate\Containe
r\Container.php:733
0.0380 1075880 6. Illuminate\Foundation\Application->make() C:\wamp\www
\laravel\vendor\laravel\framework\src\Illuminate\Container\Container.php:216
0.0380 1075880 7. Illuminate\Container\Container->make() C:\wamp\www\la
ravel\vendor\laravel\framework\src\Illuminate\Foundation\Application.php:674
0.0380 1075896 8. Illuminate\Container\Container->build() C:\wamp\www\l
aravel\vendor\laravel\framework\src\Illuminate\Container\Container.php:626
0.0380 1076072 9. ReflectionClass->__construct() C:\wamp\www\laravel\ve
ndor\laravel\framework\src\Illuminate\Container\Container.php:736
I am new to laravel and this is demo setup for one project and getting confuse with these errors.
As for the error on existing projects. Make sure the bindings in bootstrap/app.php are correct and run composer dump-autoload to clear out any lingering issues.

About Form use in Laravel5

This is my Laravel error:
FatalErrorException in compiled.php line 6376:
Class 'Illuminate\Html\HtmlServiceProvider' not found
in compiled.php line 6376
at HandleExceptions->fatalExceptionFromError(array('type' => '1', 'message' => 'Class 'Illuminate\Html\HtmlServiceProvider' not found', 'file' => '/home/nl/Laravel/storage/framework/compiled.php', 'line' => '6376')) in compiled.php line 1721
at HandleExceptions->handleShutdown()
And my console error:
Generating autoload files
PHP Fatal error: Class 'Illuminate\Html\HtmlServiceProvider' not found in /home
/nl/Laravel/storage/framework/compiled.php on line 6376
PHP Stack trace:
PHP 1. {main}() /home/nl/Laravel/artisan:0
PHP 2. Illuminate\Foundation\Console\Kernel->handle() /home/nl/Laravel/artisan
:36
PHP 3. Illuminate\Foundation\Console\Kernel->bootstrap() /home/nl/Laravel/vend
or/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:92
PHP 4. Illuminate\Foundation\Application->bootstrapWith() /home/nl/Laravel/ven
dor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:195
PHP 5. Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap() /home/nl
/Laravel/storage/framework/compiled.php:1307
PHP 6. Illuminate\Foundation\Application->registerConfiguredProviders() /home/
nl/Laravel/storage/framework/compiled.php:1758
PHP 7. Illuminate\Foundation\ProviderRepository->load() /home/nl/Laravel/stora
ge/framework/compiled.php:1404
PHP 8. Illuminate\Foundation\ProviderRepository->compileManifest() /home/nl/La
ravel/storage/framework/compiled.php:6338
PHP 9. Illuminate\Foundation\ProviderRepository->createProvider() /home/nl/Lar
avel/storage/framework/compiled.php:6362
PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Th
e stream or file "/home/nl/Laravel/storage/logs/laravel-2015-04-20.log" could no
t be opened: failed to open stream: Permission denied' in /home/nl/Laravel/stora
ge/framework/compiled.php:12372
Stack trace:
#0 /home/nl/Laravel/storage/framework/compiled.php(12431): Monolog\Handler\Strea
mHandler->write(Array)
#1 /home/nl/Laravel/storage/framework/compiled.php(12313): Monolog\Handler\Rotat
ingFileHandler->write(Array)
#2 /home/nl/Laravel/storage/framework/compiled.php(12081): Monolog\Handler\Abstr
actProcessingHandler->handle(Array)
#3 /home/nl/Laravel/storage/framework/compiled.php(12179): Monolog\Logger->addRe
cord(400, 'exception 'Symf...', Array)
#4 /home/nl/Laravel/vendor/laravel/framework/src/Illuminate/Foundation/Exception
s/Handler.php(47): Monolog\Logger->error('exception 'Symf...')
#5 /home/nl/Laravel/app/Exceptions/Handler.php(27): Illuminate\Foundation\Except
ions\Handler->report(Object(Symfony\Component\Debug\Exception\FatalErrorExceptio
n))
#6 in /home/nl/Laravel/storage/framework/compiled.php on line 12372
PHP Stack trace:
PHP 1. {main}() /home/nl/Laravel/artisan:0
PHP 2. Illuminate\Foundation\Console\Kernel->handle() /home/nl/Laravel/artisan
:36
PHP 3. Illuminate\Foundation\Console\Kernel->bootstrap() /home/nl/Laravel/vend
or/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:92
PHP 4. Illuminate\Foundation\Application->bootstrapWith() /home/nl/Laravel/ven
dor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:195
PHP 5. Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap() /home/nl
/Laravel/storage/framework/compiled.php:1307
PHP 6. Illuminate\Foundation\Application->registerConfiguredProviders() /home/
nl/Laravel/storage/framework/compiled.php:1758
PHP 7. Illuminate\Foundation\ProviderRepository->load() /home/nl/Laravel/stora
ge/framework/compiled.php:1404
PHP 8. Illuminate\Foundation\ProviderRepository->compileManifest() /home/nl/La
ravel/storage/framework/compiled.php:6338
PHP 9. Illuminate\Foundation\ProviderRepository->createProvider() /home/nl/Lar
avel/storage/framework/compiled.php:6362
Script php artisan clear-compiled handling the post-update-cmd event returned wi
th an error
[RuntimeException]
Error Output: PHP Fatal error: Class 'Illuminate\Html\HtmlServiceProvider'
not found in /home/nl/Laravel/storage/framework/compiled.php on line 6376
PHP Stack trace:
PHP 1. {main}() /home/nl/Laravel/artisan:0
PHP 2. Illuminate\Foundation\Console\Kernel->handle() /home/nl/Laravel/ar
tisan:36
PHP 3. Illuminate\Foundation\Console\Kernel->bootstrap() /home/nl/Laravel
/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:92
PHP 4. Illuminate\Foundation\Application->bootstrapWith() /home/nl/Larave
l/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:195
PHP 5. Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap() /ho
me/nl/Laravel/storage/framework/compiled.php:1307
PHP 6. Illuminate\Foundation\Application->registerConfiguredProviders() /
home/nl/Laravel/storage/framework/compiled.php:1758
PHP 7. Illuminate\Foundation\ProviderRepository->load() /home/nl/Laravel/
storage/framework/compiled.php:1404
PHP 8. Illuminate\Foundation\ProviderRepository->compileManifest() /home/
nl/Laravel/storage/framework/compiled.php:6338
PHP 9. Illuminate\Foundation\ProviderRepository->createProvider() /home/n
l/Laravel/storage/framework/compiled.php:6362
PHP Fatal error: Uncaught exception 'UnexpectedValueException' with messag
e 'The stream or file "/home/nl/Laravel/storage/logs/laravel-2015-04-20.log
" could not be opened: failed to open stream: Permission denied' in /home/n
l/Laravel/storage/framework/compiled.php:12372
Stack trace:
#0 /home/nl/Laravel/storage/framework/compiled.php(12431): Monolog\Handler\
StreamHandler->write(Array)
#1 /home/nl/Laravel/storage/framework/compiled.php(12313): Monolog\Handler\
RotatingFileHandler->write(Array)
#2 /home/nl/Laravel/storage/framework/compiled.php(12081): Monolog\Handler\
AbstractProcessingHandler->handle(Array)
#3 /home/nl/Laravel/storage/framework/compiled.php(12179): Monolog\Logger->
addRecord(400, 'exception 'Symf...', Array)
#4 /home/nl/Laravel/vendor/laravel/framework/src/Illuminate/Foundation/Exce
ptions/Handler.php(47): Monolog\Logger->error('exception 'Symf...')
#5 /home/nl/Laravel/app/Exceptions/Handler.php(27): Illuminate\Foundation\E
xceptions\Handler->report(Object(Symfony\Component\Debug\Exception\FatalErr
orException))
#6 in /home/nl/Laravel/storage/framework/compiled.php on line 12372
PHP Stack trace:
PHP 1. {main}() /home/nl/Laravel/artisan:0
PHP 2. Illuminate\Foundation\Console\Kernel->handle() /home/nl/Laravel/ar
tisan:36
PHP 3. Illuminate\Foundation\Console\Kernel->bootstrap() /home/nl/Laravel
/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:92
PHP 4. Illuminate\Foundation\Application->bootstrapWith() /home/nl/Larave
l/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:195
PHP 5. Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap() /ho
me/nl/Laravel/storage/framework/compiled.php:1307
PHP 6. Illuminate\Foundation\Application->registerConfiguredProviders() /
home/nl/Laravel/storage/framework/compiled.php:1758
PHP 7. Illuminate\Foundation\ProviderRepository->load() /home/nl/Laravel/
storage/framework/compiled.php:1404
PHP 8. Illuminate\Foundation\ProviderRepository->compileManifest() /home/
nl/Laravel/storage/framework/compiled.php:6338
PHP 9. Illuminate\Foundation\ProviderRepository->createProvider() /home/n
l/Laravel/storage/framework/compiled.php:6362
I refer to this tutorial, and am following these steps:
1."illuminate/html": "5.*"
2.Run: composer update
3.Add to the app.php providers array:
'Illuminate\Html\HtmlServiceProvider',
4.Add to the app.php aliases array:
'Html' => 'Illuminate\Html\HtmlFacade',
'Form' => 'Illuminate\Html\FormFacade',
but still not work, someone could give some advice?
I've found there is a bit of an issue with that library that composer requires - try changing:
"illuminate/Html" : "5.0.*"
To..
"Illuminate/Html": "5.0.*#dev"
in the composer.json in the root of your laravel project.
I fall this problem,solve this and wrote a blog about it.For use laravel html helper you need to require this dependency in your composesr.josn file and need to require those file.For full process follow this url http://www.kingpabel.com/laravel-html-helper/

Categories