Skip to content

TryTeleport/pipeline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Teleport Pipeline.

The teleport pipeline design pattern implementation.

class BazStage implements Teleport\Pipeline\Interfaces\StageInterface
{

	public function process($payload)
	{
		$payload->baz = "my value";
		return $payload;
	}
}


$pipeline = new Teleport\Pipeline\Pipeline;

$pipeline
	->pipe(new Teleport\Pipeline\Stages\JsonDecodeStage)
	->pipe(new BazStage)
	->pipe(function($payload)
	{
		$payload->x = "y";
		return $payload;
	})
	->pipe(new Teleport\Pipeline\Stages\JsonEncodeStage);


echo $pipeline->process('{"foo": "bar"}');

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages