PHP7 Chain Of Responsibilities

This commit is contained in:
Dominik Liebler
2016-09-22 12:17:22 +02:00
parent ea8c91ac68
commit 2b4b3beeff
10 changed files with 178 additions and 226 deletions

View File

@@ -0,0 +1,21 @@
<?php
namespace DesignPatterns\Behavioral\ChainOfResponsibilities\Responsible;
use DesignPatterns\Behavioral\ChainOfResponsibilities\Handler;
use Psr\Http\Message\RequestInterface;
class SlowDatabaseHandler extends Handler
{
/**
* @param RequestInterface $request
*
* @return string|null
*/
protected function processing(RequestInterface $request)
{
// this is a mockup, in production code you would ask a slow (compared to in-memory) DB for the results
return 'Hello World!';
}
}