RunTaskCommand::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
namespace Mistletoe\Application\Commands;
3
4
use Symfony\Component\Console\Input\InputArgument;
5
use Symfony\Component\Console\Input\InputInterface;
6
use Symfony\Component\Console\Output\OutputInterface;
7
8
/**
9
 * Class RunDueCommand
10
 * @package Mistletoe\Application\Commands
11
 */
12
class RunTaskCommand extends AbstractCommand
13
{
14
    protected function configure()
15
    {
16
        $this
17
            ->setName('run:task')
18
            ->setDescription('Run all due tasks')
19
            ->addArgument('taskName', InputArgument::REQUIRED, "Which specific registered task")
20
            ->addArgument('path', InputArgument::OPTIONAL, "Where is your Mistletoe Project File?");
21
    }
22
23
    protected function execute(InputInterface $input, OutputInterface $output)
24
    {
25
        $planner = $this->getTaskPlanner($input->getArgument('path'));
26
        $planner->runTask($input->getArgument('taskName'));
27
    }
28
}
29