In composer.json, some commands in scripts are not executed
1. Check the Scripts section in Composer.json. as shown in Figure 1
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
],
"pre-autoload-dump": "Google\\Task\\Composer::cleanup",
"lint": "phpcs --standard=PSR1,PSR2,./ruleset.xml --ignore=config/us-zipcode.php app/ routes/ config/ ",
"lint-fix": "phpcbf --standard=PSR1,PSR2 --ignore=config/us-zipcode.php app/ routes/ config/ "
}
2. When executing the command: composer install, only the commands under the pre-autoload-dump and post-autoload-dump parts are executed. as shown in Figure 2
PS E:\wwwroot\object> composer install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove
Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested.
Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
Package moontoast/math is abandoned, you should avoid using it. Use brick/math instead.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
> Google\Task\Composer::cleanup
Class Tests\Feature\LoginApiPostCartPaymentTest located in E:/wwwroot/object/tests\Feature\ApiCartPaymentTest.php does not comply with psr-4 autoloading standard. Skipping.
Class Tests\Feature\LoginApiPostCartTest located in E:/wwwroot/object/tests\Feature\ApiCartTest.php does not comply with psr-4 autoloading standard. Skipping.
Class Tests\Feature\LoginGetPaymentTest located in E:/wwwroot/object/tests\Feature\PaymentTest.php does not comply with psr-4 autoloading standard. Skipping.
Class Sofa\Eloquence\Searchable\Searchable located in E:/wwwroot/object/vendor/sofa/eloquence-base/src\Contracts\Searchable\Searchable.php does not comply with psr-4 autoloading standard. Skipping.
Class Modules\ThemeStore\Tests\FactoryTest located in E:/wwwroot/object/Modules\ThemeStore\Tests\Unit\FactoryTest.php does not comply with psr-4 autoloading standard. Skipping.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: arubacao/asset-cdn
Discovered Package: axlon/laravel-postal-code-validation
Discovered Package: barryvdh/laravel-debugbar
Discovered Package: beyondcode/laravel-dump-server
Discovered Package: beyondcode/laravel-er-diagram-generator
Discovered Package: boaideas/laravel-cli-create-user
Discovered Package: cviebrock/eloquent-sluggable
Discovered Package: dingo/api
Discovered Package: fideloper/proxy
Discovered Package: genealabs/laravel-model-caching
Discovered Package: igaster/laravel-theme
Discovered Package: ignited/laravel-omnipay
Discovered Package: intervention/image
Discovered Package: jenssegers/agent
Discovered Package: jgrossi/corcel
Discovered Package: laravel/passport
Discovered Package: laravel/scout
Discovered Package: laravel/socialite
Discovered Package: laravel/tinker
Discovered Package: laravel/ui
Discovered Package: maatwebsite/excel
Discovered Package: mavinoo/laravel-batch
Discovered Package: nesbot/carbon
Discovered Package: newobject/facebook-conversions-api
Discovered Package: nunomaduro/collision
Discovered Package: nuwave/lighthouse
Discovered Package: nwidart/laravel-modules
Discovered Package: orangehill/iseed
Discovered Package: overtrue/laravel-pinyin
Discovered Package: overtrue/laravel-wechat
Discovered Package: prettus/l5-repository
Discovered Package: s-ichikawa/laravel-sendgrid-driver
Discovered Package: sentry/sentry-laravel
Discovered Package: silber/page-cache
Discovered Package: socialiteproviders/manager
Discovered Package: sofa/eloquence-base
Discovered Package: sofa/eloquence-mutable
Discovered Package: spatie/laravel-activitylog
Discovered Package: spatie/laravel-permission
Discovered Package: spatie/laravel-query-builder
Discovered Package: spatie/laravel-sitemap
Discovered Package: tamayo/laravel-scout-elastic
Discovered Package: torann/geoip
Package manifest generated successfully.
113 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
3. The first command to execute google\task\composer::cleanup belongs to the command event: pre-autoload-dump. This event fires before the autoloader is dumped, either the install/update or dump-autoload command.
4. Execute the 2nd and 3rd commands Illuminate\Foundation\ComposerScripts::PostAutoLoaddump, @php artisan package:discover –ansi Belongs to the command event: post-autoload-dump. This event fires after the autoloader is dumped, either the install/update or dump-autoload command.
5. The post-root-package-install event is triggered after the root package is installed during the create-project command. The post-create-project-cmd event is fired after the create-project command is executed. So the 2 events are not triggered when executing the command: composer install , so none of the commands to which the events belong are executed.
6, lint, lint-fix belong to the custom composer command. Need to call manually, for example: composer lint
7. Since this project is cloned locally based on git, the create-project command is not executed. Therefore, the command under the event triggered during the create-project command needs to be executed manually. as shown in Figure 3
PS E:\wwwroot\object> php -r "file_exists('.env') || copy('.env.example', '.env');"
PS E:\wwwroot\object> php artisan key:generate --ansi
Application key set successfully.
PS E:\wwwroot\object>


