I'm working on a simple project using PHP and I'm using PSR-4 autoloading. I just wonder if there's a way to run composer dump-autoload -o
on composer install
, so that new users won't need to type composer dump-autoload -o
to avoid autoloading error
{
"name": "project/vendor",
"license": "MIT",
"authors": [
{
"name": "my name",
"email": "[email protected]"
}
],
"require": {
"phpunit/phpunit": "^7.5"
},
"autoload": {
"psr-4": {
"src\\": "src/"
}
},
"scripts": {
"run-test": ["./vendor/bin/phpunit tests/calculatorTests.php"]
}
}