PHPackages                             code-202/processor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. code-202/processor

ActiveLibrary

code-202/processor
==================

Mechanism to process a work from a request

1.0(3y ago)04MITPHPPHP &gt;8.1

Since Dec 6Pushed 3y ago1 watchersCompare

[ Source](https://github.com/code-202/processor)[ Packagist](https://packagist.org/packages/code-202/processor)[ RSS](/packages/code-202-processor/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

Processor
=========

[](#processor)

Mechanism to process a work from a request

Installation
------------

[](#installation)

You can install Processor with Composer

```
$ composer require code-202/processor
```

How to use it ?
---------------

[](#how-to-use-it-)

The main interest of this library is the `ChainProcessor`. It contains multiple processors who can procced a particular work from a request and generate a response.

The `ChainProcessor` ask to each processors contains on it if it can proceed the job for a particular request. The first processor who awser that it can do it will be use. The response contains several things like the request itself, the status code, name of processor who do the job and obviously the output of the job.

### Build a **Request**

[](#build-a-request)

Before use the processor you have to build your request. You request can be what ever you want : a simple string, an array, a object... This object will be use to determine if processor can do the job and to do it.

#### Example

[](#example)

```
