PHP code example of kami / request-processor

1. Go to this page and download the library: Download kami/request-processor 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/ */

    

kami / request-processor example snippets




use Kami\Component\RequestProcessor\Step\AbstractStep;
use Symfony\Component\HttpFoundation\Request;
use Kami\Component\RequestProcessor\ArtifactCollection;

class MyAwesomeStep extends AbstractStep
{
    public function execute(Request $request) : ArtifactCollection 
    {
        /** Your execute method */
    }
    public function getRequiredArtifacts() : array 
    {
        return ['some_artifact'];
    }
    
}



use Kami\Component\RequestProcessor\AbstractStrategy;

class MyStrategy extends AbstractStrategy
{
    public static function getSteps() : array 
    {
        return [
            new MyAwesomeStep(),
            new MyAnotherStep()    
        ];
    }
}