mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-09 08:26:44 +02:00
PHP7 Command
This commit is contained in:
@@ -11,11 +11,11 @@ class Invoker
|
||||
/**
|
||||
* @var CommandInterface
|
||||
*/
|
||||
protected $command;
|
||||
private $command;
|
||||
|
||||
/**
|
||||
* In the invoker we find this kind of method for subscribing the command.
|
||||
* There can be also a stack, a list, a fixed set...
|
||||
* in the invoker we find this kind of method for subscribing the command
|
||||
* There can be also a stack, a list, a fixed set ...
|
||||
*
|
||||
* @param CommandInterface $cmd
|
||||
*/
|
||||
@@ -25,12 +25,10 @@ class Invoker
|
||||
}
|
||||
|
||||
/**
|
||||
* executes the command.
|
||||
* executes the command; the invoker is the same whatever is the command
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
// here is a key feature of the invoker
|
||||
// the invoker is the same whatever is the command
|
||||
$this->command->execute();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user