<commit_before># Commander

Container-Interop aware Command Bus

### Usage
```php
//Initialize Commander
$commander = new Commander($container);
$commander->add('command.user.regsiter', 'UserRegisterDbHandlder');
$commander->add('command.user.regsiter', 'UserRegisterEmailHandlder');
$commander->add('command.user.regsiter', 'UserRegisterStatisticHandlder');

//.. Someplace else...
$commander->handle(new UserRegisterCommand());
//Issues the command to the 3 handlers defined
```<commit_msg>Adding Detailed Example for Command Bus<commit_after># Commander

Container-Interop aware Command Bus

### Usage
```php
//Initialize Commander
$commander = new Commander($container);
$commander->add('command.user.regsiter', 'UserRegisterDbHandlder');
$commander->add('command.user.regsiter', 'UserRegisterEmailHandlder');
$commander->add('command.user.regsiter', 'UserRegisterStatisticHandlder');

//.. Someplace else...
$commander->handle(new UserRegisterCommand());
//Issues the command to the 3 handlers defined
```

### Detailed Example
```php

$app = new Slim\App();

$container = $app->getContainer();

$container['commander'] = function ($c) {
    $commander = new Commander($c);
    $commander->add('command.user.regsiter', 'UserRegisterDbHandlder');
    $commander->add('command.user.regsiter', 'UserRegisterEmailHandlder');
    $commander->add('command.user.regsiter', 'UserRegisterStatisticHandlder');
        
    return $commander;
};

$container['UserRegisterDbHandlder'] = function ($c) {
    return new UserRegisterDbHandlder();
};


$container['UserRegisterEmailHandlder'] = function ($c) {
    return new UserRegisterEmailHandlder();
};

$container['UserRegisterStatisticHandlder'] = function ($c) {
    return new UserRegisterStatisticHandlder();
};


$app->post('/user', function ($request, $response, $args) {
    try {
        $result = $this->get('commander')->handle(new UserRegisterCommand($request->getParsedBody()));
        if ($result) {
            return $response->withStatus(200);
        } else {
            return $response->withStatus(400);s
        }
    } catch (Exception $e) {
        return $response->withStatus(500);
    }
});

$app->run();

```
{'fraction_non_alphanumeric': 0.16552040348464006, 'fraction_numerical': 0.0050435580009170105, 'mean_word_length': 5.011019283746556, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3967243', 'n_tokens_mistral': 665, 'n_tokens_neox': 628, 'n_words': 129}