nunomaduro / patrol

Patrol is an elegant command-line tool that keeps your PHP Project's dependencies in check.
MIT License
273 stars 19 forks source link

The command defined in "NunoMaduro\Patrol\Commands\InspectCommand" cannot have an empty name. #14

Open jleonardolemos opened 7 months ago

jleonardolemos commented 7 months ago

I just installed patrol and i am getting this error:

/var/www/app $ ./vendor/bin/patrol
PHP Fatal error:  Uncaught Symfony\Component\Console\Exception\LogicException: The command defined in "NunoMaduro\Patrol\Commands\InspectCommand" cannot have an empty name. in /var/www/app/vendor/symfony/console/Application.php:535
Stack trace:
#0 /var/www/app/vendor/nunomaduro/patrol/bin/patrol(30): Symfony\Component\Console\Application->add()
#1 /var/www/app/vendor/nunomaduro/patrol/bin/patrol(36): {closure}()
#2 /var/www/app/vendor/bin/patrol(119): include('...')
#3 {main}
  thrown in /var/www/app/vendor/symfony/console/Application.php on line 535
/var/www/app $ ./vendor/bin/patrol
PHP Fatal error:  Uncaught Symfony\Component\Console\Exception\LogicException: The command defined in "NunoMaduro\Patrol\Commands\InspectCommand" cannot have an empty name. in /var/www/app/vendor/symfony/console/Application.php:535
Stack trace:
#0 /var/www/app/vendor/nunomaduro/patrol/bin/patrol(30): Symfony\Component\Console\Application->add()
#1 /var/www/app/vendor/nunomaduro/patrol/bin/patrol(36): {closure}()
#2 /var/www/app/vendor/bin/patrol(119): include('...')
#3 {main}
  thrown in /var/www/app/vendor/symfony/console/Application.php on line 535

This is my aplication overview in my local environment

  Environment ..............................................................................................................  
  Application Name ................................................................................................. Laravel  
  Laravel Version ................................................................................................... 11.3.1  
  PHP Version ........................................................................................................ 8.3.0  
  Composer Version ................................................................................................... 2.6.5  
  Environment ........................................................................................................ local  
  Debug Mode ....................................................................................................... ENABLED  
  URL ............................................................................................................ localhost  
  Maintenance Mode ..................................................................................................... OFF  

  Cache ....................................................................................................................  
  Config ........................................................................................................ NOT CACHED  
  Events ........................................................................................................ NOT CACHED  
  Routes ........................................................................................................ NOT CACHED  
  Views ............................................................................................................. CACHED  

  Drivers ..................................................................................................................  
  Broadcasting ......................................................................................................... log  
  Cache ............................................................................................................... file  
  Database ........................................................................................................... mysql  
  Logs ....................................................................................................... stack / daily  
  Mail ................................................................................................................ smtp  
  Queue ............................................................................................................... sync  
  Session ............................................................................................................. file  

  Pulse ....................................................................................................................  
  Enabled .......................................................................................................... ENABLED  
  Version .................................................................................................... v1.0.0-beta16  

  Livewire .................................................................................................................  
  Livewire ......................................................................................................... v3.4.10  

  Sentry ...................................................................................................................  
  Enabled ...................................................................................................... MISSING DSN  
  Environment ........................................................................................................ local  
  Laravel SDK Version ................................................................................................ 4.4.1  
  PHP SDK Version .................................................................................................... 4.7.0  
  Release .......................................................................................................... NOT SET  
  Sample Rate Errors .................................................................................................. 100%  
  Sample Rate Performance Monitoring ............................................................................... NOT SET  
  Sample Rate Profiling ............................................................................................ NOT SET  
  Send Default PII ................................................................................................ DISABLED 

I was able to get the command working adding the $this->setName(self::$defaultName) call inside InspectCommand::configure() I just dont PR because i dont know if it is the best way to fix the problem.

ya-cha commented 7 months ago

+1. We're getting this error while upgrading to Laravel 11.

nicci296 commented 7 months ago

Same here. Fix appreciated