PHP code example of siriusphp / invokator

1. Go to this page and download the library: Download siriusphp/invokator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

siriusphp / invokator example snippets


use Sirius\Invokator\Invoker;
use Sirius\Invokator\Processors\PipelineProcessor;
use Sirius\Invokator\CallableCollection;

$container = app(); // your application DI container
$invoker = new Invoker($container)
$processor = new PipelineProcessor($invoker);

$processor->add('pipeline_name', 'trim');
$processor->add('pipeline_name', 'Str::toUppercase');
$processor->add('pipeline_name', function($value) {             // anonymous function
    return $value . '!!!';
});
$processor->add('pipeline_name', 'Logger@info');

$processor->process('pipeline_name', "  hello world  "); // returns `HELLO WORLD!!!`