Skip to content

NativeCommandHandlerResolver

Properties

handlers

protected array $handlers

container

protected ?\Codefy\CommandBus\Container $container

Methods

__construct

public __construct(?\Codefy\CommandBus\Container $container = null): mixed

Parameters:

Parameter Type Description
$container ?\Codefy\CommandBus\Container

resolve

Retrieve a CommandHandler for a given Command

public resolve(\Codefy\CommandBus\Command $command): \Codefy\CommandBus\CommandHandler

Parameters:

Parameter Type Description
$command \Codefy\CommandBus\Command

Throws:


bindHandler

Bind a handler to a command. These bindings should overrule the default resolution behavior for this resolver

public bindHandler(string $commandName, callable|\Codefy\CommandBus\CommandHandler|string $handler): mixed

Parameters:

Parameter Type Description
$commandName string
$handler callable|\Codefy\CommandBus\CommandHandler|string

Throws:



Automatically generated on 2025-10-13