mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-11 17:34:09 +02:00
PHP7 Mediator
This commit is contained in:
@@ -4,17 +4,11 @@ namespace DesignPatterns\Behavioral\Mediator\Subsystem;
|
||||
|
||||
use DesignPatterns\Behavioral\Mediator\Colleague;
|
||||
|
||||
/**
|
||||
* Server serves responses.
|
||||
*/
|
||||
class Server extends Colleague
|
||||
{
|
||||
/**
|
||||
* process on server.
|
||||
*/
|
||||
public function process()
|
||||
{
|
||||
$data = $this->getMediator()->queryDb();
|
||||
$this->getMediator()->sendResponse("Hello $data");
|
||||
$data = $this->mediator->queryDb();
|
||||
$this->mediator->sendResponse(sprintf("Hello %s", $data));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user