protected function executeSymfonyCmdHook(CommandHookInterface $command_hook, $method)
    {
        $command = $command_hook->getCommand();

        $container = ProjectX::getContainer();
        $application = $container->get('application');

        try {
            $info = $this->getCommandInfo($method);
            $command = $application->find($command);

            if ($command->getName() === $info->getName()) {
                throw new \Exception(sprintf(
                    'Unable to call the %s command hook due to it ' .
                    'invoking the parent method.',
                    $command->getName()
                ));
            }
        } catch (CommandNotFoundException $exception) {
            throw new CommandHookRuntimeException(sprintf(
                'Unable to find %s command in the project-x command ' .
                'hook.',
                $command
            ));
        } catch (\Exception $exception) {
            throw new CommandHookRuntimeException($exception->getMessage());
        }
        $exec = $this->taskSymfonyCommand($command);
        $definition = $command->getDefinition();

        // Support symfony command options.
        if ($command_hook->hasOptions()) {
            foreach ($command_hook->getOptions() as $option => $value) {
                if (is_numeric($option)) {
                    $option = $value;
                    $value = null;
                }
                if (!$definition->hasOption($option)) {
                    continue;
                }
                $exec->opt($option, $value);
            }
        }

        // Support symfony command arguments.
        if ($command_hook->hasArguments()) {
            foreach ($command_hook->getArguments() as $arg => $value) {
                if (!isset($value) || !$definition->hasArgument($arg)) {
                    continue;
                }
                $exec->arg($arg, $value);
            }
        }

        return $exec->run();
    }