- WIP on annotation support

This commit is contained in:
Dave Mc Nicoll committed 2021-10-19 12:49:23 +00:00
1 parent 1eb891a283
commit 2432792a9d
2 files changed
+23 -4

No files matched your search

+16 -1
View File
@@ -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;
}
}