mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-11 17:34:09 +02:00
update deps & install rector
This commit is contained in:
@@ -8,16 +8,11 @@ namespace DesignPatterns\Behavioral\Command;
|
||||
*/
|
||||
class AddMessageDateCommand implements UndoableCommand
|
||||
{
|
||||
/**
|
||||
* @var Receiver
|
||||
*/
|
||||
private $output;
|
||||
private Receiver $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.
|
||||
*
|
||||
* @param Receiver $console
|
||||
*/
|
||||
public function __construct(Receiver $console)
|
||||
{
|
||||
|
@@ -8,16 +8,11 @@ namespace DesignPatterns\Behavioral\Command;
|
||||
*/
|
||||
class HelloCommand implements Command
|
||||
{
|
||||
/**
|
||||
* @var Receiver
|
||||
*/
|
||||
private $output;
|
||||
private Receiver $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
|
||||
*
|
||||
* @param Receiver $console
|
||||
*/
|
||||
public function __construct(Receiver $console)
|
||||
{
|
||||
|
@@ -8,16 +8,11 @@ namespace DesignPatterns\Behavioral\Command;
|
||||
*/
|
||||
class Invoker
|
||||
{
|
||||
/**
|
||||
* @var Command
|
||||
*/
|
||||
private $command;
|
||||
private Command $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 ...
|
||||
*
|
||||
* @param Command $cmd
|
||||
*/
|
||||
public function setCommand(Command $cmd)
|
||||
{
|
||||
|
@@ -3,23 +3,17 @@
|
||||
namespace DesignPatterns\Behavioral\Command;
|
||||
|
||||
/**
|
||||
* Receiver is specific service with its own contract and can be only concrete.
|
||||
* Receiver is a specific service with its own contract and can be only concrete.
|
||||
*/
|
||||
class Receiver
|
||||
{
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $enableDate = false;
|
||||
private bool $enableDate = false;
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
private $output = [];
|
||||
private array $output = [];
|
||||
|
||||
/**
|
||||
* @param string $str
|
||||
*/
|
||||
public function write(string $str)
|
||||
{
|
||||
if ($this->enableDate) {
|
||||
|
Reference in New Issue
Block a user