hmazter / laravel-schedule-list

Laravel package to add command to list all scheduled artisan commands
MIT License
94 stars 14 forks source link

InvalidArgumentException : Console command definition is empty. #23

Closed mfn closed 6 years ago

mfn commented 6 years ago

Tried it on Laravel 5.7.3 with 1.1.0 :

$ ./artisan schedule:list

   InvalidArgumentException  : Console command definition is empty.

  at /vagrant/project/vendor/laravel/framework/src/Illuminate/Console/Parser.php: 44
  40:      */
  41:     protected static function name($expression)
  42:     {
  43:         if (trim($expression) === '') {
  44:             throw new InvalidArgumentException('Console command definition is empty.');
  45:         }
  46:
  47:         if (! preg_match('/[^\s]+/', $expression, $matches)) {
  48:             throw new InvalidArgumentException('Unable to determine command name from signature.');
  49:         }

  Exception trace:

  1   Illuminate\Console\Parser::name("")
      /vagrant/project/vendor/laravel/framework/src/Illuminate/Console/Parser.php : 22

  2   Illuminate\Console\Parser::parse("")
      /vagrant/project/vendor/hmazter/laravel-schedule-list/src/ScheduleEvent.php : 115

  Please use the argument -v to see more details.

It seems this package doesn't support callback based scheduling jobs as outlined at https://laravel.com/docs/5.7/scheduling#defining-schedules ?

In a project of mine I've >15 scheduled tasks and almost all are defined via ->call() because I wrap the executed code for logging purpose.

hmazter commented 6 years ago

Hi! Thanks for reporting this issue, I will take a look at it as soon as I can and see if it can be fixed within a reasonable time.

hmazter commented 6 years ago

It seems I can avoid the crash, but I'm unable to get any interesting to show other than "Closure" when a closure is scheduled, and of course the specified description.

hmazter commented 6 years ago

Please take a look at #24 for a possible "solution" for this.