ah-b / oil
flexible package for manage complex domain logic
Installs: 20
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/ah-b/oil
Requires (Dev)
- phpunit/phpunit: ^7.5
This package is auto-updated.
Last update: 2025-09-29 02:21:14 UTC
README
composer require ah-b/oil "0.1"
Usage
$pipelineService = new OilService(new Pipeline()); $pipelineService->add(new Test()); $pipelineService->run('my payload');
class Test { public function __invoke($payload) { return $payload; } }
mediate
$pipelineService = new OilService(new Mediator()); $pipelineService->add(function($payload){ echo $payload; }); $pipelineService->run('my payload');
Scenario
public function indexController() { $databaseRecord = "test"; if($databaseRecord == "test") { // do some logic } if($databaseRecord == "foo") { // do some logic } if($databaseRecord == "bar") { // do some logic } ... }
public function indexController() { $databaseRecord = "test"; $pipelineService = new OilService(new Pipeline()); $pipelineService->add(new Test()); $pipelineService->add(new Foo()); $pipelineService->add(new Bar()); $pipelineService->run($databaseRecord); ... }