src/Zicht/Tool/Command/TaskCommand.php
protected function execute(InputInterface $input, Output\OutputInterface $output)
    {
        foreach ($this->getDefinition()->getArguments() as $arg) {
            if ($arg->getName() === 'command') {
                continue;
            }
            if ($input->getArgument($arg->getName())) {
                $this->getContainer()->set(explode('.', $this->nameToVar($arg->getName())), $input->getArgument($arg->getName()));
            }
        }

        foreach ($this->opts as $opt) {
            if ($value = $input->getOption($this->varToName($opt))) {
                $this->getContainer()->set(explode('.', $opt), $value);
            }
        }

        foreach ($this->flags as $name => $value) {
            $varName = explode('.', $name);
            $optName = $this->varToName($name);
            $this->getContainer()->set($varName, $value);

            if ($input->getOption('no-' . $optName) && $input->getOption($optName)) {
                throw new \InvalidArgumentException("Conflicting options --no-{$optName} and --{$optName} supplied. That confuses me.");
            }
            if ($input->getOption('no-' . $optName)) {
                $this->getContainer()->set($varName, false);
            } elseif ($input->getOption($optName)) {
                $this->getContainer()->set($varName, true);
            }
        }

        $callable = $this->getContainer()->get($this->getTaskReference());
        call_user_func($callable, $this->getContainer());
    }
protected function execute(InputInterface $input, Output\OutputInterface $output)
    {
        foreach ($this->getDefinition()->getArguments() as $arg) {
            if ($arg->getName() === 'command') {
                continue;
            }
            if ($input->getArgument($arg->getName())) {
                $this->getContainer()->set(explode('.', $this->nameToVar($arg->getName())), $input->getArgument($arg->getName()));
            }
        }

        foreach ($this->opts as $opt) {
            if ($value = $input->getOption($this->varToName($opt))) {
                $this->getContainer()->set(explode('.', $opt), $value);
            }
        }

        foreach ($this->flags as $name => $value) {
            $varName = explode('.', $name);
            $optName = $this->varToName($name);
            $this->getContainer()->set($varName, $value);

            if ($input->getOption('no-' . $optName) && $input->getOption($optName)) {
                throw new \InvalidArgumentException("Conflicting options --no-{$optName} and --{$optName} supplied. That confuses me.");
            }
            if ($input->getOption('no-' . $optName)) {
                $this->getContainer()->set($varName, false);
            } elseif ($input->getOption($optName)) {
                $this->getContainer()->set($varName, true);
            }
        }

        $callable = $this->getContainer()->get($this->getTaskReference());
        call_user_func($callable, $this->getContainer());
    }
protected function execute ( InputInterface $ input , Output \ OutputInterface $ output ) { foreach ( $ this -> getDefinition ( ) -> getArguments ( ) as $ arg ) { if ( $ arg -> getName ( ) === 'command' ) { continue ; } if ( $ input -> getArgument ( $ arg -> getName ( ) ) ) { $ this -> getContainer ( ) -> set ( explode ( '.' , $ this -> nameToVar ( $ arg -> getName ( ) ) ) , $ input -> getArgument ( $ arg -> getName ( ) ) ) ; } } foreach ( $ this -> opts as $ opt ) { if ( $ value = $ input -> getOption ( $ this -> varToName ( $ opt ) ) ) { $ this -> getContainer ( ) -> set ( explode ( '.' , $ opt ) , $ value ) ; } } foreach ( $ this -> flags as $ name => $ value ) { $ varName = explode ( '.' , $ name ) ; $ optName = $ this -> varToName ( $ name ) ; $ this -> getContainer ( ) -> set ( $ varName , $ value ) ; if ( $ input -> getOption ( 'no-' . $ optName ) && $ input -> getOption ( $ optName ) ) { throw new \ InvalidArgumentException ( "Conflicting options --no-{$optName} and --{$optName} supplied. That confuses me." ) ; } if ( $ input -> getOption ( 'no-' . $ optName ) ) { $ this -> getContainer ( ) -> set ( $ varName , false ) ; } elseif ( $ input -> getOption ( $ optName ) ) { $ this -> getContainer ( ) -> set ( $ varName , true ) ; } } $ callable = $ this -> getContainer ( ) -> get ( $ this -> getTaskReference ( ) ) ; call_user_func ( $ callable , $ this -> getContainer ( ) ) ; }
Executes the specified task

@param \Symfony\Component\Console\Input\InputInterface $input
@param \Symfony\Component\Console\Output\OutputInterface $output
@return mixed
Executes the specified task