2017 © Pedro Peláez
 

library relay-transform

Transform Middleware for Relay

image

flipboxdigital/relay-transform

Transform Middleware for Relay

  • Tuesday, June 6, 2017
  • by nateiler
  • Repository
  • 2 Watchers
  • 0 Stars
  • 5,767 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 7 % Grown

The README.md

Relay - Transform

Latest Version Software License Build Status Coverage Status Quality Score Total Downloads, (*1)

This package provides a Transform Middleware leveraging Transform and Stash., (*2)

Installation

To install, use composer:, (*3)

composer require flipboxdigital/relay-transform

Testing

``` bash $ ./vendor/bin/phpunit, (*4)


## Usage ```php $request = new Zend\Diactoros\Request(); $response = new Zend\Diactoros\Response(); $data = [ 'firstName' => 'foo', 'lastName' => 'bar', 'dateCreated' => new \DateTime(), 'dateUpdated' => new \DateTime() ]; $queue = [ [ 'class' => Flipbox\Relay\Middleware\Transform\Item::class, 'data' => $data, 'transformer' => function($data) { return [ 'name' => [ 'first' => $data['firstName'], 'last' => $data['firstName'] ], 'date' => [ 'created' => $data['dateCreated']->format('c'), 'updated' => $data['dateUpdated']->format('c') ] ] } ] ]; // Relay runner $runner = new Runner( $queue, RelayHelper::createResolver() ); // Relay runner $runner = new Relay\Runner( $queue, Flipbox\Relay\Helpers\RelayHelper::createResolver() ); // Run $response = $runner($request, $response);

Contributing

Please see CONTRIBUTING for details., (*5)

Credits

License

The MIT License (MIT). Please see License File for more information., (*6)

The Versions

06/06 2017

dev-master

9999999-dev

Transform Middleware for Relay

  Sources   Download

MIT

The Requires

 

The Development Requires

by Flipbox Factory

middleware psr-7 transform relay flipbox

06/06 2017

dev-develop

dev-develop

Transform Middleware for Relay

  Sources   Download

MIT

The Requires

 

The Development Requires

by Flipbox Factory

middleware psr-7 transform relay flipbox

06/06 2017

1.0.0

1.0.0.0

Transform Middleware for Relay

  Sources   Download

MIT

The Requires

 

The Development Requires

by Flipbox Factory

middleware psr-7 transform relay flipbox