mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-06-05 05:24:57 +02:00
remove Interface-Suffix
This commit is contained in:
parent
132de8e34e
commit
b72515a9af
3
.gitignore
vendored
3
.gitignore
vendored
@ -15,3 +15,6 @@ composer.phar
|
||||
|
||||
# translations
|
||||
*.mo
|
||||
|
||||
# general
|
||||
.DS_Store
|
||||
|
@ -7,7 +7,7 @@ namespace DesignPatterns\Behavioral\Command;
|
||||
* This concrete command tweaks receiver to add current date to messages
|
||||
* invoker just knows that it can call "execute"
|
||||
*/
|
||||
class AddMessageDateCommand implements UndoableCommandInterface
|
||||
class AddMessageDateCommand implements UndoableCommand
|
||||
{
|
||||
/**
|
||||
* @var Receiver
|
||||
|
@ -3,7 +3,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace DesignPatterns\Behavioral\Command;
|
||||
|
||||
interface CommandInterface
|
||||
interface Command
|
||||
{
|
||||
/**
|
||||
* this is the most important method in the Command pattern,
|
@ -7,7 +7,7 @@ namespace DesignPatterns\Behavioral\Command;
|
||||
* This concrete command calls "print" on the Receiver, but an external
|
||||
* invoker just knows that it can call "execute"
|
||||
*/
|
||||
class HelloCommand implements CommandInterface
|
||||
class HelloCommand implements Command
|
||||
{
|
||||
/**
|
||||
* @var Receiver
|
||||
|
@ -10,7 +10,7 @@ namespace DesignPatterns\Behavioral\Command;
|
||||
class Invoker
|
||||
{
|
||||
/**
|
||||
* @var CommandInterface
|
||||
* @var Command
|
||||
*/
|
||||
private $command;
|
||||
|
||||
@ -18,9 +18,9 @@ class Invoker
|
||||
* 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
|
||||
* @param Command $cmd
|
||||
*/
|
||||
public function setCommand(CommandInterface $cmd)
|
||||
public function setCommand(Command $cmd)
|
||||
{
|
||||
$this->command = $cmd;
|
||||
}
|
||||
|
@ -38,9 +38,9 @@ Code
|
||||
|
||||
You can also find this code on `GitHub`_
|
||||
|
||||
CommandInterface.php
|
||||
Command.php
|
||||
|
||||
.. literalinclude:: CommandInterface.php
|
||||
.. literalinclude:: Command.php
|
||||
:language: php
|
||||
:linenos:
|
||||
|
||||
@ -72,4 +72,4 @@ Tests/CommandTest.php
|
||||
:linenos:
|
||||
|
||||
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Behavioral/Command
|
||||
.. __: http://en.wikipedia.org/wiki/Command_pattern
|
||||
.. __: http://en.wikipedia.org/wiki/Command_pattern
|
||||
|
@ -3,7 +3,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace DesignPatterns\Behavioral\Command;
|
||||
|
||||
interface UndoableCommandInterface extends CommandInterface
|
||||
interface UndoableCommand extends Command
|
||||
{
|
||||
/**
|
||||
* This method is used to undo change made by command execution
|
@ -1,28 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Diagram>
|
||||
<ID>PHP</ID>
|
||||
<OriginalElement>\DesignPatterns\Behavioral\Command\HelloCommand</OriginalElement>
|
||||
<nodes>
|
||||
<node x="185.0" y="15.0">\DesignPatterns\Behavioral\Command\Invoker</node>
|
||||
<node x="0.0" y="97.0">\DesignPatterns\Behavioral\Command\HelloCommand</node>
|
||||
<node x="189.0" y="139.0">\DesignPatterns\Behavioral\Command\Receiver</node>
|
||||
<node x="10.0" y="0.0">\DesignPatterns\Behavioral\Command\CommandInterface</node>
|
||||
</nodes>
|
||||
<notes />
|
||||
<edges>
|
||||
<edge source="\DesignPatterns\Behavioral\Command\HelloCommand" target="\DesignPatterns\Behavioral\Command\CommandInterface">
|
||||
<point x="0.0" y="-44.5" />
|
||||
<point x="0.0" y="23.5" />
|
||||
</edge>
|
||||
</edges>
|
||||
<settings layout="Hierarchic Group" zoom="1.0" x="171.0" y="93.0" />
|
||||
<SelectedNodes />
|
||||
<Categories>
|
||||
<Category>Fields</Category>
|
||||
<Category>Constants</Category>
|
||||
<Category>Constructors</Category>
|
||||
<Category>Methods</Category>
|
||||
</Categories>
|
||||
<VISIBILITY>private</VISIBILITY>
|
||||
</Diagram>
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Diagram>
|
||||
<ID>PHP</ID>
|
||||
<OriginalElement>\DesignPatterns\Behavioral\Command\AddMessageDateCommand</OriginalElement>
|
||||
<nodes>
|
||||
<node x="0.0" y="246.0">\DesignPatterns\Behavioral\Command\AddMessageDateCommand</node>
|
||||
<node x="22.5" y="123.0">\DesignPatterns\Behavioral\Command\UndoableCommand</node>
|
||||
<node x="124.75" y="0.0">\DesignPatterns\Behavioral\Command\Command</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>
|
||||
<notes />
|
||||
<edges>
|
||||
<edge source="\DesignPatterns\Behavioral\Command\HelloCommand" target="\DesignPatterns\Behavioral\Command\Command">
|
||||
<point x="0.0" y="-48.0" />
|
||||
<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>
|
||||
</edges>
|
||||
<settings layout="Hierarchic Group" zoom="1.0" x="145.0" y="200.5" />
|
||||
<SelectedNodes />
|
||||
<Categories>
|
||||
<Category>Fields</Category>
|
||||
<Category>Constants</Category>
|
||||
<Category>Constructors</Category>
|
||||
<Category>Methods</Category>
|
||||
</Categories>
|
||||
<VISIBILITY>private</VISIBILITY>
|
||||
</Diagram>
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 75 KiB |
Loading…
x
Reference in New Issue
Block a user