public function listCommand()
    {
        $this->console->writeLn('tasks list:');

        $tasks = [];
        $tasksDir = $this->alias->resolve('@app/Tasks');
        if (is_dir($tasksDir)) {
            foreach (glob("$tasksDir/*Task.php") as $file) {
                $task = basename($file, 'Task.php');
                $tasks[] = ['name' => Text::underscore($task), 'desc' => $this->_getTaskDescription($task)];
            }
        }
        $width = max(array_map(static function ($v) {
                return strlen($v['name']);
            }, $tasks)) + 3;
        foreach ($tasks as $task) {
            $this->console->writeLn(['    :1 :2', $this->console->colorize($task['name'], Console::FC_MAGENTA, $width), $task['desc']]);
        }
    }
public function listCommand()
    {
        $this->console->writeLn('tasks list:');

        $tasks = [];
        $tasksDir = $this->alias->resolve('@app/Tasks');
        if (is_dir($tasksDir)) {
            foreach (glob("$tasksDir/*Task.php") as $file) {
                $task = basename($file, 'Task.php');
                $tasks[] = ['name' => Text::underscore($task), 'desc' => $this->_getTaskDescription($task)];
            }
        }
        $width = max(array_map(static function ($v) {
                return strlen($v['name']);
            }, $tasks)) + 3;
        foreach ($tasks as $task) {
            $this->console->writeLn(['    :1 :2', $this->console->colorize($task['name'], Console::FC_MAGENTA, $width), $task['desc']]);
        }
    }
public function listCommand ( ) { $ this -> console -> writeLn ( 'tasks list:' ) ; $ tasks = [ ] ; $ tasksDir = $ this -> alias -> resolve ( '@app/Tasks' ) ; if ( is_dir ( $ tasksDir ) ) { foreach ( glob ( "$tasksDir/*Task.php" ) as $ file ) { $ task = basename ( $ file , 'Task.php' ) ; $ tasks [ ] = [ 'name' => Text :: underscore ( $ task ) , 'desc' => $ this -> _getTaskDescription ( $ task ) ] ; } } $ width = max ( array_map ( static function ( $ v ) { return strlen ( $ v [ 'name' ] ) ; } , $ tasks ) ) + 3 ; foreach ( $ tasks as $ task ) { $ this -> console -> writeLn ( [ '    :1 :2' , $ this -> console -> colorize ( $ task [ 'name' ] , Console :: FC_MAGENTA , $ width ) , $ task [ 'desc' ] ] ) ; } }
list all tasks
list all tasks