Exemplo n.º 1
0
 /**
  * Registers any commands found the the provided path.
  *
  * Note: All classes found in the folder are loaded, so don't put anything
  *       but commands there.
  *
  * @param string $commandPath
  *
  * @return array
  */
 private function registerCommandsIn(string $commandPath) : array
 {
     $commands = [];
     foreach ((new ClassFinder())->findClasses($commandPath) as $command) {
         $commands[] = Lib::get_class_name($command);
         $this->add(new $command());
     }
     return $commands;
 }