mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-06 15:06:31 +02:00
PHP7 Chain Of Responsibilities
This commit is contained in:
@@ -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!';
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user