remove Interface-Suffix

This commit is contained in:
Dominik Liebler
2019-08-19 16:54:21 +02:00
parent 132de8e34e
commit b72515a9af
9 changed files with 55 additions and 38 deletions

3
.gitignore vendored
View File

@@ -15,3 +15,6 @@ composer.phar
# translations # translations
*.mo *.mo
# general
.DS_Store

View File

@@ -7,7 +7,7 @@ namespace DesignPatterns\Behavioral\Command;
* This concrete command tweaks receiver to add current date to messages * This concrete command tweaks receiver to add current date to messages
* invoker just knows that it can call "execute" * invoker just knows that it can call "execute"
*/ */
class AddMessageDateCommand implements UndoableCommandInterface class AddMessageDateCommand implements UndoableCommand
{ {
/** /**
* @var Receiver * @var Receiver

View File

@@ -3,7 +3,7 @@ declare(strict_types=1);
namespace DesignPatterns\Behavioral\Command; namespace DesignPatterns\Behavioral\Command;
interface CommandInterface interface Command
{ {
/** /**
* this is the most important method in the Command pattern, * this is the most important method in the Command pattern,

View File

@@ -7,7 +7,7 @@ namespace DesignPatterns\Behavioral\Command;
* This concrete command calls "print" on the Receiver, but an external * 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 class HelloCommand implements Command
{ {
/** /**
* @var Receiver * @var Receiver

View File

@@ -10,7 +10,7 @@ namespace DesignPatterns\Behavioral\Command;
class Invoker class Invoker
{ {
/** /**
* @var CommandInterface * @var Command
*/ */
private $command; private $command;
@@ -18,9 +18,9 @@ class Invoker
* in the invoker we find this kind of method for subscribing the 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 ... * There can be also a stack, a list, a fixed set ...
* *
* @param CommandInterface $cmd * @param Command $cmd
*/ */
public function setCommand(CommandInterface $cmd) public function setCommand(Command $cmd)
{ {
$this->command = $cmd; $this->command = $cmd;
} }

View File

@@ -38,9 +38,9 @@ Code
You can also find this code on `GitHub`_ You can also find this code on `GitHub`_
CommandInterface.php Command.php
.. literalinclude:: CommandInterface.php .. literalinclude:: Command.php
:language: php :language: php
:linenos: :linenos:

View File

@@ -3,7 +3,7 @@ declare(strict_types=1);
namespace DesignPatterns\Behavioral\Command; namespace DesignPatterns\Behavioral\Command;
interface UndoableCommandInterface extends CommandInterface interface UndoableCommand extends Command
{ {
/** /**
* This method is used to undo change made by command execution * This method is used to undo change made by command execution

View File

@@ -1,21 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Diagram> <Diagram>
<ID>PHP</ID> <ID>PHP</ID>
<OriginalElement>\DesignPatterns\Behavioral\Command\HelloCommand</OriginalElement> <OriginalElement>\DesignPatterns\Behavioral\Command\AddMessageDateCommand</OriginalElement>
<nodes> <nodes>
<node x="185.0" y="15.0">\DesignPatterns\Behavioral\Command\Invoker</node> <node x="0.0" y="246.0">\DesignPatterns\Behavioral\Command\AddMessageDateCommand</node>
<node x="0.0" y="97.0">\DesignPatterns\Behavioral\Command\HelloCommand</node> <node x="22.5" y="123.0">\DesignPatterns\Behavioral\Command\UndoableCommand</node>
<node x="189.0" y="139.0">\DesignPatterns\Behavioral\Command\Receiver</node> <node x="124.75" y="0.0">\DesignPatterns\Behavioral\Command\Command</node>
<node x="10.0" y="0.0">\DesignPatterns\Behavioral\Command\CommandInterface</node> <node x="0.0" y="409.0">\DesignPatterns\Behavioral\Command\Invoker</node>
<node x="177.5" y="100.0">\DesignPatterns\Behavioral\Command\HelloCommand</node>
<node x="402.5" y="0.0">\DesignPatterns\Behavioral\Command\Receiver</node>
</nodes> </nodes>
<notes /> <notes />
<edges> <edges>
<edge source="\DesignPatterns\Behavioral\Command\HelloCommand" target="\DesignPatterns\Behavioral\Command\CommandInterface"> <edge source="\DesignPatterns\Behavioral\Command\HelloCommand" target="\DesignPatterns\Behavioral\Command\Command">
<point x="0.0" y="-44.5" /> <point x="0.0" y="-48.0" />
<point x="0.0" y="23.5" /> <point x="267.5" y="75.0" />
<point x="205.75" y="75.0" />
<point x="27.0" y="25.0" />
</edge>
<edge source="\DesignPatterns\Behavioral\Command\UndoableCommand" target="\DesignPatterns\Behavioral\Command\Command">
<point x="0.0" y="-25.0" />
<point x="90.0" y="75.0" />
<point x="151.75" y="75.0" />
<point x="-27.0" y="25.0" />
</edge>
<edge source="\DesignPatterns\Behavioral\Command\AddMessageDateCommand" target="\DesignPatterns\Behavioral\Command\UndoableCommand">
<point x="0.0" y="-59.0" />
<point x="0.0" y="25.0" />
</edge> </edge>
</edges> </edges>
<settings layout="Hierarchic Group" zoom="1.0" x="171.0" y="93.0" /> <settings layout="Hierarchic Group" zoom="1.0" x="145.0" y="200.5" />
<SelectedNodes /> <SelectedNodes />
<Categories> <Categories>
<Category>Fields</Category> <Category>Fields</Category>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 75 KiB