Filesystem: use is_dir() instead of file_exists() which is faster
Filesystem: use is_dir() instead of file_exists() which is faster

this reproducible saves 1-2 seconds while running `COMPOSER_DISABLE_NETWORK=1 php
 composer/bin/composer install -vvv --profile` on the rector/rector project

johnstevenson/composer,staabm/composer,stof/composer,milleruk/composer,alcohol/composer,nicolas-grekas/composer,composer/composer,stefangr/composer,localheinz/composer