CommandProcessor
class CommandProcessor implements LoggerAwareInterface (View source)
Process a command, including hooks and other callbacks.
There should only be one command processor per application. Provide your command processor to the AnnotatedCommandFactory via AnnotatedCommandFactory::setCommandProcessor().
Traits
Properties
| protected HookManager | $hookManager | ||
| protected FormatterManager | $formatterManager | ||
| protected PrepareFormatterOptions[] | $prepareOptionsList | ||
| protected bool | $passExceptions | ||
| protected ResultWriter | $resultWriter | ||
| protected ParameterInjection | $parameterInjection | 
Methods
Return the hook manager
No description
No description
No description
No description
No description
Set a mode to make the annotated command library re-throw any exception that it catches while processing a command.
Return the formatter manager
No description
Update the FormatterOptions object with validated command options.
Handle the result output and status code calculation.
No description
Details
        
                            
    __construct(HookManager $hookManager)
        
    
    No description
        
                            HookManager
    hookManager()
        
    
    Return the hook manager
        
                            
    resultWriter()
        
    
    No description
        
                            
    setResultWriter($resultWriter)
        
    
    No description
        
                            
    parameterInjection()
        
    
    No description
        
                            
    setParameterInjection($parameterInjection)
        
    
    No description
        
                            
    addPrepareFormatter(PrepareFormatter $preparer)
        
    
    No description
        
                            
    setFormatterManager(FormatterManager $formatterManager)
        
    
    No description
        
                            
    setDisplayErrorFunction(callable $fn)
        
    
    No description
        
                            
    setPassExceptions($passExceptions)
        
    
    Set a mode to make the annotated command library re-throw any exception that it catches while processing a command.
The default behavior in the current (2.x) branch is to catch the exception and replace it with a CommandError object that may be processed by the normal output processing passthrough.
In the 3.x branch, exceptions will never be caught; they will be passed through, as if setPassExceptions(true) were called. This is the recommended behavior.
        
                            
    commandErrorForException(Exception $e)
        
    
    No description
        
                            FormatterManager
    formatterManager()
        
    
    Return the formatter manager
        
                            
    initializeHook(InputInterface $input, $names, AnnotationData $annotationData)
        
    
    No description
        
                            
    optionsHook(AnnotatedCommand $command, $names, AnnotationData $annotationData)
        
    
    No description
        
                            
    interact(InputInterface $input, OutputInterface $output, $names, AnnotationData $annotationData)
        
    
    No description
        
                            
    process(OutputInterface $output, $names, $commandCallback, CommandData $commandData)
        
    
    No description
        
                            
    validateRunAndAlter($names, $commandCallback, CommandData $commandData)
        
    
    No description
        
                            
    processResults($names, $result, CommandData $commandData)
        
    
    No description
        
                    protected        FormatterOptions
    updateFormatterOptions(CommandData $commandData)
        
    
    Update the FormatterOptions object with validated command options.
Also runs the perparers.
        
                            
    handleResults(OutputInterface $output, $names, $result, CommandData $commandData)
        
    
    Handle the result output and status code calculation.
        
                    protected        
    runCommandCallback($commandCallback, CommandData $commandData)
        
    
    Run the main command callback
        
                            
    injectIntoCommandData($commandData, $injectedClasses)
        
    
    No description