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\Callables\CallablePipeline;

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

$pipeline = new CallablePipeline($invoker);
$pipeline->add('trim')
         ->add('Str::toUppercase')
         ->add(function($value) {
             return $value . '!!!';
         })
         ->add('Logger@info');

$pipeline->run("  hello world  "); // returns `HELLO WORLD!!!`