private function buildDefinition(\ReflectionMethod $method, $token = null)
    {
        $definition = new InputDefinition();

        foreach ($method->getParameters() as $parameter) {
            if ($parameter->isDefaultValueAvailable()) {
                //option
                $definition->addOption(new InputOption($parameter->getName(), null, InputOption::VALUE_REQUIRED, null, $parameter->isDefaultValueAvailable() ? $parameter->getDefaultValue() : null));
            } else {
                //argument
                $definition->addArgument(new InputArgument($parameter->getName(), InputArgument::REQUIRED, null, null));
            }
        }

        $definition->addOption(new InputOption('token', null, InputOption::VALUE_REQUIRED, 'the auth token to use', $token));
        $definition->addOption(new InputOption('debug', null, InputOption::VALUE_NONE, 'display raw response'));

        return $definition;
    }
private function buildDefinition(\ReflectionMethod $method, $token = null)
    {
        $definition = new InputDefinition();

        foreach ($method->getParameters() as $parameter) {
            if ($parameter->isDefaultValueAvailable()) {
                //option
                $definition->addOption(new InputOption($parameter->getName(), null, InputOption::VALUE_REQUIRED, null, $parameter->isDefaultValueAvailable() ? $parameter->getDefaultValue() : null));
            } else {
                //argument
                $definition->addArgument(new InputArgument($parameter->getName(), InputArgument::REQUIRED, null, null));
            }
        }

        $definition->addOption(new InputOption('token', null, InputOption::VALUE_REQUIRED, 'the auth token to use', $token));
        $definition->addOption(new InputOption('debug', null, InputOption::VALUE_NONE, 'display raw response'));

        return $definition;
    }
private function buildDefinition ( \ ReflectionMethod $ method , $ token = null ) { $ definition = new InputDefinition ( ) ; foreach ( $ method -> getParameters ( ) as $ parameter ) { if ( $ parameter -> isDefaultValueAvailable ( ) ) { //option $ definition -> addOption ( new InputOption ( $ parameter -> getName ( ) , null , InputOption :: VALUE_REQUIRED , null , $ parameter -> isDefaultValueAvailable ( ) ? $ parameter -> getDefaultValue ( ) : null ) ) ; } else { //argument $ definition -> addArgument ( new InputArgument ( $ parameter -> getName ( ) , InputArgument :: REQUIRED , null , null ) ) ; } } $ definition -> addOption ( new InputOption ( 'token' , null , InputOption :: VALUE_REQUIRED , 'the auth token to use' , $ token ) ) ; $ definition -> addOption ( new InputOption ( 'debug' , null , InputOption :: VALUE_NONE , 'display raw response' ) ) ; return $ definition ; }
builds the Input Definition based upon Api Method Parameters.

@param \ReflectionMethod $method
@param string            $token

@return InputDefinition
builds the Input Definition based upon Api Method Parameters .