Getting following error while compilation using this command : php bin/magento setup:di:compile after upgrade Magento 2.1.7 to 2.1.9 check below error for more information :
Warning: ltrim() expects parameter 1 to be string, array given in
/MagentoRoot/setup/src/Magento/Setup/Module/Di/Compiler/Config/Chain/BackslashTrim.php
on line 61
Best Answer
I came across this and turned out to be an issue when you run integration tests at some point before running
bin/magento setup:di:compile
.Integration tests generate some test modules in
app/code/Magento
which are then picked up by thesetup:di:compile
command. I fixed this by removing theMagento
folder fromapp/code
.