Uname: Linux webm012.cluster130.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Software: Apache
PHP version: 8.0.30 [ PHP INFO ] PHP os: Linux
Server Ip: 145.239.37.162
Your Ip: 216.73.216.190
User: dreampi (1009562) | Group: users (100)
Safe Mode: OFF
Disable Function:
_dyuweyrj4,_dyuweyrj4r,dl

name : QuickStart.php
<?php

namespace League\Tactician\Setup;

use League\Tactician\CommandBus;
use League\Tactician\Handler\CommandNameExtractor\ClassNameExtractor;
use League\Tactician\Handler\Locator\InMemoryLocator;
use League\Tactician\Handler\MethodNameInflector\HandleInflector;
use League\Tactician\Handler\CommandHandlerMiddleware;
use League\Tactician\Plugins\LockingMiddleware;

/**
 * Builds a working command bus with minimum fuss.
 *
 * Currently, the default setup is:
 * - Handlers instances in memory
 * - The expected handler method is always "handle"
 * - And only one command at a time can be executed.
 *
 * This factory is a decent place to start trying out Tactician but you're
 * better off moving to a custom setup or a framework bundle/module/provider in
 * the long run. As you can see, it's not difficult. :)
 */
class QuickStart
{
    /**
     * Creates a default CommandBus that you can get started with.
     *
     * @param array $commandToHandlerMap
     *
     * @return CommandBus
     */
    public static function create($commandToHandlerMap)
    {
        $handlerMiddleware = new CommandHandlerMiddleware(
            new ClassNameExtractor(),
            new InMemoryLocator($commandToHandlerMap),
            new HandleInflector()
        );

        $lockingMiddleware = new LockingMiddleware();

        return new CommandBus([$lockingMiddleware, $handlerMiddleware]);
    }
}
© 2026 GrazzMean-Shell