PHP Class Illuminate\Bus\Dispatcher

Inheritance: implements Illuminate\Contracts\Bus\Dispatcher, implements Illuminate\Contracts\Bus\QueueingDispatcher, implements Illuminate\Contracts\Bus\HandlerResolver
Afficher le fichier Open project: ctrlaltdylan/MirrorMirror Class Usage Examples

Protected Properties

Свойство Type Description
$container Illuminate\Contracts\Container\Container The container implementation.
$mapper Closure The fallback mapping Closure.
$mappings array All of the command-to-handler mappings.
$pipeline Illuminate\Pipeline\Pipeline The pipeline instance for the bus.
$pipes array The pipes to send commands through before dispatching.
$queueResolver Closure | null The queue resolver callback.

Méthodes publiques

Méthode Description
__construct ( Illuminate\Contracts\Container\Container $container, Closure $queueResolver = null ) : void Create a new command dispatcher instance.
dispatch ( mixed $command, Closure $afterResolving = null ) : mixed Dispatch a command to its appropriate handler.
dispatchFrom ( mixed $command, ArrayAccess $source, array $extras = [] ) : mixed Marshal a command and dispatch it to its appropriate handler.
dispatchFromArray ( mixed $command, array $array ) : mixed Marshal a command and dispatch it to its appropriate handler.
dispatchNow ( mixed $command, Closure $afterResolving = null ) : mixed Dispatch a command to its appropriate handler in the current process.
dispatchToQueue ( mixed $command ) : mixed Dispatch a command to its appropriate handler behind a queue.
getHandlerClass ( mixed $command ) : string Get the handler class for the given command.
getHandlerMethod ( mixed $command ) : string Get the handler method for the given command.
mapUsing ( Closure $mapper ) : void Register a fallback mapper callback.
maps ( array $commands ) : void Register command-to-handler mappings.
pipeThrough ( array $pipes ) Set the pipes through which commands should be piped before dispatching.
resolveHandler ( mixed $command ) : mixed Get the handler instance for the given command.
simpleMapping ( mixed $command, string $commandNamespace, string $handlerNamespace ) : string Map the command to a handler within a given root namespace.

Méthodes protégées

Méthode Description
commandShouldBeQueued ( mixed $command ) : boolean Determine if the given command should be queued.
getMapperSegment ( mixed $command, integer $segment ) : string Get the given segment from a given class handler using the custom mapper.
getMappingSegment ( string $className, integer $segment ) : string Get the given segment from a given class handler.
getParameterValueForCommand ( string $command, ArrayAccess $source, ReflectionParameter $parameter, array $extras = [] ) : mixed Get a parameter value for a marshaled command.
inflectSegment ( mixed $command, integer $segment ) : string Get the given handler segment for the given command.
marshal ( string $command, ArrayAccess $source, array $extras = [] ) : mixed Marshal a command from the given array accessible object.
marshalFromArray ( string $command, array $array ) : mixed Marshal a command from the given array.
pushCommandToQueue ( Illuminate\Contracts\Queue\Queue $queue, mixed $command ) : mixed Push the command onto the given queue instance.

Method Details

__construct() public méthode

Create a new command dispatcher instance.
public __construct ( Illuminate\Contracts\Container\Container $container, Closure $queueResolver = null ) : void
$container Illuminate\Contracts\Container\Container
$queueResolver Closure
Résultat void

commandShouldBeQueued() protected méthode

Determine if the given command should be queued.
protected commandShouldBeQueued ( mixed $command ) : boolean
$command mixed
Résultat boolean

dispatch() public méthode

Dispatch a command to its appropriate handler.
public dispatch ( mixed $command, Closure $afterResolving = null ) : mixed
$command mixed
$afterResolving Closure
Résultat mixed

dispatchFrom() public méthode

Marshal a command and dispatch it to its appropriate handler.
public dispatchFrom ( mixed $command, ArrayAccess $source, array $extras = [] ) : mixed
$command mixed
$source ArrayAccess
$extras array
Résultat mixed

dispatchFromArray() public méthode

Marshal a command and dispatch it to its appropriate handler.
public dispatchFromArray ( mixed $command, array $array ) : mixed
$command mixed
$array array
Résultat mixed

dispatchNow() public méthode

Dispatch a command to its appropriate handler in the current process.
public dispatchNow ( mixed $command, Closure $afterResolving = null ) : mixed
$command mixed
$afterResolving Closure
Résultat mixed

dispatchToQueue() public méthode

Dispatch a command to its appropriate handler behind a queue.
public dispatchToQueue ( mixed $command ) : mixed
$command mixed
Résultat mixed

getHandlerClass() public méthode

Get the handler class for the given command.
public getHandlerClass ( mixed $command ) : string
$command mixed
Résultat string

getHandlerMethod() public méthode

Get the handler method for the given command.
public getHandlerMethod ( mixed $command ) : string
$command mixed
Résultat string

getMapperSegment() protected méthode

Get the given segment from a given class handler using the custom mapper.
protected getMapperSegment ( mixed $command, integer $segment ) : string
$command mixed
$segment integer
Résultat string

getMappingSegment() protected méthode

Get the given segment from a given class handler.
protected getMappingSegment ( string $className, integer $segment ) : string
$className string
$segment integer
Résultat string

getParameterValueForCommand() protected méthode

Get a parameter value for a marshaled command.
protected getParameterValueForCommand ( string $command, ArrayAccess $source, ReflectionParameter $parameter, array $extras = [] ) : mixed
$command string
$source ArrayAccess
$parameter ReflectionParameter
$extras array
Résultat mixed

inflectSegment() protected méthode

Get the given handler segment for the given command.
protected inflectSegment ( mixed $command, integer $segment ) : string
$command mixed
$segment integer
Résultat string

mapUsing() public méthode

Register a fallback mapper callback.
public mapUsing ( Closure $mapper ) : void
$mapper Closure
Résultat void

maps() public méthode

Register command-to-handler mappings.
public maps ( array $commands ) : void
$commands array
Résultat void

marshal() protected méthode

Marshal a command from the given array accessible object.
protected marshal ( string $command, ArrayAccess $source, array $extras = [] ) : mixed
$command string
$source ArrayAccess
$extras array
Résultat mixed

marshalFromArray() protected méthode

Marshal a command from the given array.
protected marshalFromArray ( string $command, array $array ) : mixed
$command string
$array array
Résultat mixed

pipeThrough() public méthode

Set the pipes through which commands should be piped before dispatching.
public pipeThrough ( array $pipes )
$pipes array

pushCommandToQueue() protected méthode

Push the command onto the given queue instance.
protected pushCommandToQueue ( Illuminate\Contracts\Queue\Queue $queue, mixed $command ) : mixed
$queue Illuminate\Contracts\Queue\Queue
$command mixed
Résultat mixed

resolveHandler() public méthode

Get the handler instance for the given command.
public resolveHandler ( mixed $command ) : mixed
$command mixed
Résultat mixed

simpleMapping() public static méthode

Map the command to a handler within a given root namespace.
public static simpleMapping ( mixed $command, string $commandNamespace, string $handlerNamespace ) : string
$command mixed
$commandNamespace string
$handlerNamespace string
Résultat string

Property Details

$container protected_oe property

The container implementation.
protected Container,Illuminate\Contracts\Container $container
Résultat Illuminate\Contracts\Container\Container

$mapper protected_oe property

The fallback mapping Closure.
protected Closure $mapper
Résultat Closure

$mappings protected_oe property

All of the command-to-handler mappings.
protected array $mappings
Résultat array

$pipeline protected_oe property

The pipeline instance for the bus.
protected Pipeline,Illuminate\Pipeline $pipeline
Résultat Illuminate\Pipeline\Pipeline

$pipes protected_oe property

The pipes to send commands through before dispatching.
protected array $pipes
Résultat array

$queueResolver protected_oe property

The queue resolver callback.
protected Closure|null $queueResolver
Résultat Closure | null