- WIP on annotation support
This commit is contained in:
1 parent
1eb891a283
commit
2432792a9d
2 files changed
+23
-4
No files matched your search
+16
-1
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace Cronard;
|
||||
|
||||
use Notes\Cronard\TaskFetcher;
|
||||
|
||||
trait CronardTrait {
|
||||
|
||||
public array $crontabs = [];
|
||||
@@ -22,8 +24,21 @@ trait CronardTrait {
|
||||
throw new \RuntimeException("Given crontab file cannot be found. There could also be a problem at permission level.");
|
||||
}
|
||||
|
||||
$this->crontabs = include($filepath);
|
||||
$this->crontabs = array_merge($this->crontabs, include($filepath));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function fromAnnotations(TaskFetcher $fetcher) : self
|
||||
{
|
||||
$tasks = [];
|
||||
|
||||
/* foreach($fetcher->compile() as $task) {
|
||||
dump($task);
|
||||
}
|
||||
|
||||
$this->crontabs = array_merge($this->crontabs, $tasks);
|
||||
*/
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user