2017 © Pedro Peláez
 

library request-processor

Request processor component

image

kami/request-processor

Request processor component

  • Friday, June 1, 2018
  • by ama3ing
  • Repository
  • 2 Watchers
  • 1 Stars
  • 667 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

KAMI RequestProcessor

Build Status Scrutinizer Code Quality Code Coverage, (*1)

Abstract

Intention of this component is providing more abstract layer to handling http requests. Utilizing Strategy pattern, this RequestProcessor gives you possibility to dramatically reduce amount of repeating code in your applications, (*2)

Installation

composer require kami/request-processor

Usage

Firstly you will need your steps extending RequestProcessor\AbstractStep, (*3)

<?php

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'];
    }

}

Build up your strategy, (*4)

<?php

use Kami\Component\RequestProcessor\AbstractStrategy;

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

The one and the only requirement for your strategy is it should end up with at least two artifacts data and status, (*5)

The Versions

01/06 2018

dev-master

9999999-dev

Request processor component

  Sources   Download

MIT

The Requires

 

The Development Requires

31/05 2018

v1.1

1.1.0.0

Request processor component

  Sources   Download

MIT

The Requires

 

The Development Requires

30/05 2018

v1.0

1.0.0.0

Request processor component

  Sources   Download

MIT

The Requires

 

The Development Requires