barryvdh / laravel-ide-helper

IDE Helper for Laravel
MIT License
14.17k stars 1.16k forks source link

Hard-to-debug error on empty post_migrate #1389

Closed damms005 closed 7 months ago

damms005 commented 1 year ago

Versions:

Description:

When the post_migrate key of the config file has an array with empty value, it causes Symphony's console application handler to error (as expected) like below:

TypeError

Symfony\Component\Console\Application::has(): Argument #1 ($name) must be of type string, null given, called in ...vendor/laravel/framework/src/Illuminate/Console/Application.php on line 202

While this is expected behaviour, this package may be helpful in such scenarios. In my particular case, I set it as:

'post_migrate' => [
    (env('APP_ENV') == 'local' ? 'ide-helper:models -N' : ''
]

Steps To Reproduce:

mfn commented 7 months ago

PR was rejected, therefore closing issue too (workaround was given with array_filter)