minor #40516 [HttpKernel] Add is_file() check before include (burned42)
minor #40516 [HttpKernel] Add is_file() check before include (burned42)

This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] Add is_file() check before include

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes (?)
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

I recently noticed that on every deployment I got warnings reported by sentry from the `cache:clear` command.

> Warning: include(/var/www/html/var/cache/pro_/App_KernelProdContainer.php): failed to open stream: No such file or directory

In `Symfony\Component\HttpKernel\Kernel` [line 469](https://github.com/symfony/symfony/blob/5.x/src/Symfony/Component/HttpKernel/Kernel.php#L469)
 (on 4.4 it's on [line 536](https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/HttpKernel/Kernel.php#L536))

This is because the code tries to include the `$cachePath` without checking if it exists/is a file first. It seems like something similar was fixed some time ago already (https://github.com/symfony/symfony/pull/27249) some lines above.

This PR fixes the mentioned warnings for me.

I'm running on Symfony 5.2.5 at the moment, but the docs said that bugfixes should target branch 4.4 and new features should target 5.x, and I guess this could rather be seen as a bugfix than a new feature, so I branched off of 4.4 and also set this as target for the PR, I hope that's correct.

Commits
-------

8efcc17573 [HttpKernel] do is_file check before include

derrabus/symfony,Tobion/symfony,ogizanagi/symfony,symfony/symfony,curry684/symfony,Nyholm/symfony,hhamon/symfony,Taluu/symfony,oleg-andreyev/symfony,paradajozsef/symfony,curry684/symfony,oleg-andreyev/symfony,OskarStark/symfony,sgehrig/symfony,oleg-andreyev/symfony,oleg-andreyev/symfony,Slamdunk/symfony,hhamon/symfony,OskarStark/symfony,xabbuh/symfony,tucksaun/symfony,damienalexandre/symfony,mpdude/symfony,stof/symfony,curry684/symfony,xabbuh/symfony,stof/symfony,OskarStark/symfony,derrabus/symfony,hhamon/symfony,Slamdunk/symfony,d-ph/symfony,stof/symfony,hhamon/symfony,damienalexandre/symfony,Tobion/symfony,symfony/symfony,MatTheCat/symfony,phramz/symfony,zerkms/symfony,Taluu/symfony,Slamdunk/symfony,mpdude/symfony,Tobion/symfony,d-ph/symfony,ogizanagi/symfony,paradajozsef/symfony,tucksaun/symfony,ogizanagi/symfony,HeahDude/symfony,Tobion/symfony,ogizanagi/symfony,nicolas-grekas/symfony,xabbuh/symfony,ro0NL/symfony,OskarStark/symfony,MatTheCat/symfony,nicolas-grekas/symfony,symfony/symfony,tucksaun/symfony,zerkms/symfony,phramz/symfony,HeahDude/symfony,sgehrig/symfony,HeahDude/symfony,Nyholm/symfony,sgehrig/symfony,stof/symfony,damienalexandre/symfony,Nyholm/symfony,Taluu/symfony,tucksaun/symfony,nicolas-grekas/symfony,zerkms/symfony,derrabus/symfony,ro0NL/symfony,ro0NL/symfony,mpdude/symfony,xabbuh/symfony,MatTheCat/symfony,phramz/symfony,symfony/symfony,Slamdunk/symfony,nicolas-grekas/symfony,mpdude/symfony,d-ph/symfony,Nyholm/symfony,sgehrig/symfony,phramz/symfony,ro0NL/symfony,paradajozsef/symfony,zerkms/symfony,d-ph/symfony,damienalexandre/symfony,MatTheCat/symfony,HeahDude/symfony,paradajozsef/symfony,Taluu/symfony,curry684/symfony,derrabus/symfony