Bristol SU Support Package
CommandStore.php
Go to the documentation of this file.
1 <?php
2 
4 
6 
11 {
12 
25  private $commands = [];
26 
36  public function schedule($alias, $command, $cron)
37  {
38  if (!array_key_exists($alias, $this->commands)) {
39  $this->commands[$alias] = [];
40  }
41  $this->commands[$alias][$command] = $cron;
42  }
43 
49  public function all()
50  {
51  return $this->commands;
52  }
53 
60  public function forAlias(string $alias)
61  {
62  return (isset($this->commands, $alias) ?
63  $this->commands[$alias] : []);
64  }
65 
66 }