PHP7 Command

This commit is contained in:
Dominik Liebler
2016-09-22 09:25:26 +02:00
parent 1da5772226
commit a6b09d6b18
8 changed files with 40 additions and 77 deletions

View File

@@ -4,18 +4,18 @@ namespace DesignPatterns\Behavioral\Command;
/**
* This concrete command calls "print" on the Receiver, but an external
* invoker just knows that it can call "execute".
* invoker just knows that it can call "execute"
*/
class HelloCommand implements CommandInterface
{
/**
* @var Receiver
*/
protected $output;
private $output;
/**
* Each concrete command is built with different receivers.
* There can be one, many or completely no receivers, but there can be other commands in the parameters.
* There can be one, many or completely no receivers, but there can be other commands in the parameters
*
* @param Receiver $console
*/
@@ -29,8 +29,7 @@ class HelloCommand implements CommandInterface
*/
public function execute()
{
// sometimes, there is no receiver and this is the command which
// does all the work
// sometimes, there is no receiver and this is the command which does all the work
$this->output->write('Hello World');
}
}