bug #23092 [Filesystem] added workaround in Filesystem::rename for PHP bug (VolCh)
bug #23092 [Filesystem] added workaround in Filesystem::rename for PHP bug (VolCh)

This PR was squashed before being merged into the 2.7 branch (closes #23092).

Discussion
----------

[Filesystem] added workaround in Filesystem::rename for PHP bug

[Filesystem] added workaround in Filesystem::rename for https://bugs.php.net/bug.php?id=54097

Standard PHP rename() of dirs across devices/mounted filesystems  produces confusing copy error & throws IOException in Filesystem::rename. I got it during console cache:clear  in the Docker environment. This PR possible fixes https://github.com/symfony/symfony/issues/19851 and other environment related issues.

Workaround is on \rename() fails try to Filesystem::mirror & Filesystem::remove if $origin is directory

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

3ccbc479da [Filesystem] added workaround in Filesystem::rename for PHP bug

c960657/symfony,OndraM/symfony,pierredup/symfony,mpdude/symfony,mvhirsch/symfony,smatyas/symfony,tgalopin/symfony,mnapoli/symfony,kbond/symfony,alekitto/symfony,Einenlum/symfony,joelwurtz/symfony,Einenlum/symfony,jvasseur/symfony,shieldo/symfony,gonzalovilaseca/symfony,weaverryan/symfony,paradajozsef/symfony,ajgarlag/symfony,maidmaid/symfony,hacfi/symfony,frankdejonge/symfony,zcodes/symfony,oleg-andreyev/symfony,OskarStark/symfony,lepiaf/symfony,tucksaun/symfony,iltar/symfony,phramz/symfony,voronkovich/symfony,Nyholm/symfony,SpacePossum/symfony,mnapoli/symfony,joelwurtz/symfony,josephdpurcell/symfony,smatyas/symfony,apetitpa/symfony,arjenm/symfony,jean-gui/symfony,pamil/symfony,aeoris/symfony,smatyas/symfony,Deamon/symfony,bendavies/symfony,apetitpa/symfony,gnat42/symfony,Amo/symfony,kbond/symfony,hacfi/symfony,weaverryan/symfony,oleg-andreyev/symfony,inso/symfony,OndraM/symfony,josephdpurcell/symfony,bendavies/symfony,Slamdunk/symfony,symfony/symfony,gnat42/symfony,andreia/symfony,mvhirsch/symfony,deguif/symfony,HeahDude/symfony,ogizanagi/symfony,OndraM/symfony,gnat42/symfony,Soullivaneuh/symfony,Einenlum/symfony,tucksaun/symfony,Soullivaneuh/symfony,chalasr/symfony,andrerom/symfony,zerkms/symfony,OskarStark/symfony,pamil/symfony,lyrixx/symfony,deguif/symfony,weaverryan/symfony,gimler/symfony,sgehrig/symfony,DavidGarciaCat/symfony,sgehrig/symfony,tgalopin/symfony,d-ph/symfony,yceruto/symfony,Pierstoval/symfony,MatTheCat/symfony,pyrech/symfony,andreia/symfony,andreia/symfony,sgehrig/symfony,michaelperrin/symfony,e-moe/symfony,SpacePossum/symfony,jzawadzki/symfony,ragboyjr/symfony,frankdejonge/symfony,hason/symfony,apetitpa/symfony,tucksaun/symfony,gimler/symfony,damienalexandre/symfony,jderusse/symfony,codeclimate-testing/symfony,nasimnabavi/symfony,hhamon/symfony,localheinz/symfony,dunglas/symfony,Tobion/symfony,voronkovich/symfony,tgalopin/symfony,fabpot/symfony,Pierstoval/symfony,bendavies/symfony,dunglas/symfony,e-moe/symfony,Simperfit/symfony,lyrixx/symfony,Einenlum/symfony,gimler/symfony,pamil/symfony,hason/symfony,jean-gui/symfony,hhamon/symfony,weaverryan/symfony,xabbuh/symfony,d-ph/symfony,garak/symfony,gnat42/symfony,Deamon/symfony,teohhanhui/symfony,maidmaid/symfony,dunglas/symfony,SaschaDens/symfony,jzawadzki/symfony,iltar/symfony,vincentaubert/symfony,gonzalovilaseca/symfony,zcodes/symfony,Simperfit/symfony,nicolas-grekas/symfony,dmaicher/symfony,OskarStark/symfony,ogizanagi/symfony,mnapoli/symfony,zcodes/symfony,DavidGarciaCat/symfony,localheinz/symfony,nasimnabavi/symfony,frankdejonge/symfony,xabbuh/symfony,ro0NL/symfony,phramz/symfony,localheinz/symfony,jderusse/symfony,zcodes/symfony,damienalexandre/symfony,codeclimate-testing/symfony,arjenm/symfony,1ed/symfony,gonzalovilaseca/symfony,mihai-stancu/symfony,HeahDude/symfony,e-moe/symfony,andrerom/symfony,teohhanhui/symfony,codeclimate-testing/symfony,fabpot/symfony,chalasr/symfony,lepiaf/symfony,backbone87/symfony,ajgarlag/symfony,HeahDude/symfony,Simperfit/symfony,ogizanagi/symfony,gonzalovilaseca/symfony,docteurklein/symfony,Simperfit/symfony,gencer/symfony,Tobion/symfony,ragboyjr/symfony,nasimnabavi/symfony,WhiteEagle88/symfony,voronkovich/symfony,alekitto/symfony,Tobion/symfony,paradajozsef/symfony,Nyholm/symfony,mnapoli/symfony,mihai-stancu/symfony,michaelperrin/symfony,deguif/symfony,shieldo/symfony,yceruto/symfony,zorn-v/symfony,Koc/symfony,hacfi/symfony,Tobion/symfony,garak/symfony,nasimnabavi/symfony,shieldo/symfony,lepiaf/symfony,Deamon/symfony,Soullivaneuh/symfony,jakzal/symfony,ragboyjr/symfony,andrerom/symfony,lstrojny/symfony,symfony/symfony,SaschaDens/symfony,michaelperrin/symfony,sgehrig/symfony,maidmaid/symfony,josephdpurcell/symfony,joelwurtz/symfony,mweimerskirch/symfony,chalasr/symfony,SaschaDens/symfony,romaricdrigon/symfony,Taluu/symfony,xabbuh/symfony,alekitto/symfony,curry684/symfony,sroze/symfony,inso/symfony,MatTheCat/symfony,tgalopin/symfony,tucksaun/symfony,d-ph/symfony,backbone87/symfony,teohhanhui/symfony,vincentaubert/symfony,MatTheCat/symfony,Nyholm/symfony,mpdude/symfony,ragboyjr/symfony,c960657/symfony,Triiistan/symfony,OskarStark/symfony,Triiistan/symfony,voronkovich/symfony,fabpot/symfony,Slamdunk/symfony,zerkms/symfony,nicolas-grekas/symfony,ajgarlag/symfony,inso/symfony,ro0NL/symfony,garak/symfony,derrabus/symfony,jderusse/symfony,hason/symfony,phramz/symfony,damienalexandre/symfony,jvasseur/symfony,Koc/symfony,kbond/symfony,derrabus/symfony,SaschaDens/symfony,aeoris/symfony,lstrojny/symfony,inso/symfony,c960657/symfony,nicolas-grekas/symfony,aeoris/symfony,zorn-v/symfony,ogizanagi/symfony,arjenm/symfony,chalasr/symfony,OndraM/symfony,maidmaid/symfony,jvasseur/symfony,sroze/symfony,gencer/symfony,phramz/symfony,paradajozsef/symfony,OndraM/symfony,curry684/symfony,Triiistan/symfony,Taluu/symfony,Soullivaneuh/symfony,docteurklein/symfony,pamil/symfony,stof/symfony,hhamon/symfony,yceruto/symfony,backbone87/symfony,jean-gui/symfony,smatyas/symfony,Aliance/symfony,Triiistan/symfony,pyrech/symfony,c960657/symfony,bendavies/symfony,oleg-andreyev/symfony,zerkms/symfony,mihai-stancu/symfony,pyrech/symfony,zorn-v/symfony,ro0NL/symfony,nicolas-grekas/symfony,lstrojny/symfony,Pierstoval/symfony,joelwurtz/symfony,Aliance/symfony,codeclimate-testing/symfony,Taluu/symfony,dmaicher/symfony,sroze/symfony,apetitpa/symfony,derrabus/symfony,pierredup/symfony,1ed/symfony,romaricdrigon/symfony,Koc/symfony,SpacePossum/symfony,romaricdrigon/symfony,michaelperrin/symfony,arjenm/symfony,mpdude/symfony,Amo/symfony,mvhirsch/symfony,pierredup/symfony,jakzal/symfony,oleg-andreyev/symfony,andreia/symfony,vincentaubert/symfony,mweimerskirch/symfony,derrabus/symfony,mihai-stancu/symfony,zerkms/symfony,shieldo/symfony,Simperfit/symfony,mweimerskirch/symfony,fabpot/symfony,mihai-stancu/symfony,mweimerskirch/symfony,pyrech/symfony,symfony/symfony,Amo/symfony,docteurklein/symfony,localheinz/symfony,Strate/symfony,HeahDude/symfony,mnapoli/symfony,iltar/symfony,ajgarlag/symfony,1ed/symfony,gencer/symfony,jean-gui/symfony,lyrixx/symfony,Nyholm/symfony,andrerom/symfony,Triiistan/symfony,vincentaubert/symfony,WhiteEagle88/symfony,mpdude/symfony,alekitto/symfony,paradajozsef/symfony,SpacePossum/symfony,mweimerskirch/symfony,zorn-v/symfony,gimler/symfony,MatTheCat/symfony,Taluu/symfony,Koc/symfony,SaschaDens/symfony,jakzal/symfony,curry684/symfony,lyrixx/symfony,Soullivaneuh/symfony,Slamdunk/symfony,docteurklein/symfony,1ed/symfony,docteurklein/symfony,e-moe/symfony,Amo/symfony,Strate/symfony,teohhanhui/symfony,jakzal/symfony,Aliance/symfony,garak/symfony,iltar/symfony,Deamon/symfony,pierredup/symfony,jvasseur/symfony,WhiteEagle88/symfony,romaricdrigon/symfony,stof/symfony,ro0NL/symfony,d-ph/symfony,Strate/symfony,Deamon/symfony,stof/symfony,SpacePossum/symfony,symfony/symfony,mvhirsch/symfony,deguif/symfony,mvhirsch/symfony,xabbuh/symfony,stof/symfony,Amo/symfony,frankdejonge/symfony,dmaicher/symfony,dmaicher/symfony,damienalexandre/symfony,jderusse/symfony,hhamon/symfony,kbond/symfony,Pierstoval/symfony,inso/symfony,smatyas/symfony,curry684/symfony,yceruto/symfony,DavidGarciaCat/symfony,Slamdunk/symfony,jzawadzki/symfony,sroze/symfony