PHP-100 / Beginner
Including development dependencies and test files in production deployments
Why is this a problem?
tests/, .git/ and phpunit.xml become web-accessible or increase the attack surface.
How to fix it
bash
composer install --no-dev --optimize-autoloader
rsync -a --exclude '.git' --exclude 'tests' ./ /var/www/app/
# Block .git and tests on the web server; only public is the document root