Add Client Class in Command Pattern.

This commit is contained in:
Marcus Sa
2014-05-03 00:52:54 -03:00
parent 1a07685d41
commit 7f3856f688

22
Command/Client.php Normal file
View File

@@ -0,0 +1,22 @@
<?php
namespace DesignPatterns\Command;
/**
* Client is responsible for creating a ConcreteCommand and setting its a Receiver
*/
class Client
{
/**
* Creates a ConcreteCommand object, sets its receiver and test invoker
*/
public function run()
{
$receiver = new Receiver();
$helloCommand = new HelloCommand($receiver);
$invoker = new Invoker();
$invoker->setCommand($helloCommand);
$invoker->run();
}
}