예제 #1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $_item = $input->getArgument('todo');
     $tm = new TodoManager(new Filesystem());
     $item = new TodoItem($_item);
     $tm->saveItem($item);
     $output->writeln('Item added');
 }
예제 #2
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $number = $input->getArgument('number');
     $tm = new TodoManager(new Filesystem());
     if ($tm->removeByNumber($number)) {
         $output->writeln("Todo finished - good job!");
     } else {
         $output->writeln("Can't find todo with this number, check again.");
     }
 }
예제 #3
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $tm = new TodoManager(new Filesystem());
     $tm->setExtra($input->getArgument('extra'));
     $todoList = $tm->getItems();
     if ($todoList->isLoaded()) {
         $todoList->reverse();
         foreach ($todoList as $k => $item) {
             if ($item->render()) {
                 $output->writeln($item->render());
             }
         }
     } else {
         $output->writeln("Todo list is empty");
     }
 }