diff --git a/src/TaskFetcher.php b/src/TaskFetcher.php index b01489e..0b572df 100644 --- a/src/TaskFetcher.php +++ b/src/TaskFetcher.php @@ -80,9 +80,7 @@ class TaskFetcher { # Should generate an equivalent of Ulmus's object reflection here ! $objectResolver = new ObjectResolver($class, true, true, false, true); - $taskList = $objectResolver->getAnnotationListFromClassname( $this->annotations['method'], false ); - - foreach($taskList as $func => $cronard) { + foreach($objectResolver->getAnnotationListFromClassname( $this->annotations['method'], false ) as $func => $cronard) { foreach($cronard as $task) { $list[] = [ 'class' => $class, 'method' => $func, 'annotation' => $task ]; } @@ -90,7 +88,7 @@ class TaskFetcher { } - return $list; + return $list ?? []; }); }