Skip to content

Commit b72515a

Browse files
author
Dominik Liebler
committed
remove Interface-Suffix
1 parent 132de8e commit b72515a

File tree

9 files changed

+55
-38
lines changed

9 files changed

+55
-38
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ composer.phar
1515

1616
# translations
1717
*.mo
18+
19+
# general
20+
.DS_Store

Behavioral/Command/AddMessageDateCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* This concrete command tweaks receiver to add current date to messages
88
* invoker just knows that it can call "execute"
99
*/
10-
class AddMessageDateCommand implements UndoableCommandInterface
10+
class AddMessageDateCommand implements UndoableCommand
1111
{
1212
/**
1313
* @var Receiver

Behavioral/Command/CommandInterface.php renamed to Behavioral/Command/Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace DesignPatterns\Behavioral\Command;
55

6-
interface CommandInterface
6+
interface Command
77
{
88
/**
99
* this is the most important method in the Command pattern,

Behavioral/Command/HelloCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* This concrete command calls "print" on the Receiver, but an external
88
* invoker just knows that it can call "execute"
99
*/
10-
class HelloCommand implements CommandInterface
10+
class HelloCommand implements Command
1111
{
1212
/**
1313
* @var Receiver

Behavioral/Command/Invoker.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
class Invoker
1111
{
1212
/**
13-
* @var CommandInterface
13+
* @var Command
1414
*/
1515
private $command;
1616

1717
/**
1818
* in the invoker we find this kind of method for subscribing the command
1919
* There can be also a stack, a list, a fixed set ...
2020
*
21-
* @param CommandInterface $cmd
21+
* @param Command $cmd
2222
*/
23-
public function setCommand(CommandInterface $cmd)
23+
public function setCommand(Command $cmd)
2424
{
2525
$this->command = $cmd;
2626
}

Behavioral/Command/README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ Code
3838

3939
You can also find this code on `GitHub`_
4040

41-
CommandInterface.php
41+
Command.php
4242

43-
.. literalinclude:: CommandInterface.php
43+
.. literalinclude:: Command.php
4444
:language: php
4545
:linenos:
4646

@@ -72,4 +72,4 @@ Tests/CommandTest.php
7272
:linenos:
7373

7474
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Behavioral/Command
75-
.. __: http://en.wikipedia.org/wiki/Command_pattern
75+
.. __: http://en.wikipedia.org/wiki/Command_pattern

Behavioral/Command/UndoableCommandInterface.php renamed to Behavioral/Command/UndoableCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace DesignPatterns\Behavioral\Command;
55

6-
interface UndoableCommandInterface extends CommandInterface
6+
interface UndoableCommand extends Command
77
{
88
/**
99
* This method is used to undo change made by command execution

Behavioral/Command/uml/Command.uml

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,42 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<Diagram>
3-
<ID>PHP</ID>
4-
<OriginalElement>\DesignPatterns\Behavioral\Command\HelloCommand</OriginalElement>
5-
<nodes>
6-
<node x="185.0" y="15.0">\DesignPatterns\Behavioral\Command\Invoker</node>
7-
<node x="0.0" y="97.0">\DesignPatterns\Behavioral\Command\HelloCommand</node>
8-
<node x="189.0" y="139.0">\DesignPatterns\Behavioral\Command\Receiver</node>
9-
<node x="10.0" y="0.0">\DesignPatterns\Behavioral\Command\CommandInterface</node>
10-
</nodes>
11-
<notes />
12-
<edges>
13-
<edge source="\DesignPatterns\Behavioral\Command\HelloCommand" target="\DesignPatterns\Behavioral\Command\CommandInterface">
14-
<point x="0.0" y="-44.5" />
15-
<point x="0.0" y="23.5" />
16-
</edge>
17-
</edges>
18-
<settings layout="Hierarchic Group" zoom="1.0" x="171.0" y="93.0" />
19-
<SelectedNodes />
20-
<Categories>
21-
<Category>Fields</Category>
22-
<Category>Constants</Category>
23-
<Category>Constructors</Category>
24-
<Category>Methods</Category>
25-
</Categories>
26-
<VISIBILITY>private</VISIBILITY>
27-
</Diagram>
28-
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Diagram>
3+
<ID>PHP</ID>
4+
<OriginalElement>\DesignPatterns\Behavioral\Command\AddMessageDateCommand</OriginalElement>
5+
<nodes>
6+
<node x="0.0" y="246.0">\DesignPatterns\Behavioral\Command\AddMessageDateCommand</node>
7+
<node x="22.5" y="123.0">\DesignPatterns\Behavioral\Command\UndoableCommand</node>
8+
<node x="124.75" y="0.0">\DesignPatterns\Behavioral\Command\Command</node>
9+
<node x="0.0" y="409.0">\DesignPatterns\Behavioral\Command\Invoker</node>
10+
<node x="177.5" y="100.0">\DesignPatterns\Behavioral\Command\HelloCommand</node>
11+
<node x="402.5" y="0.0">\DesignPatterns\Behavioral\Command\Receiver</node>
12+
</nodes>
13+
<notes />
14+
<edges>
15+
<edge source="\DesignPatterns\Behavioral\Command\HelloCommand" target="\DesignPatterns\Behavioral\Command\Command">
16+
<point x="0.0" y="-48.0" />
17+
<point x="267.5" y="75.0" />
18+
<point x="205.75" y="75.0" />
19+
<point x="27.0" y="25.0" />
20+
</edge>
21+
<edge source="\DesignPatterns\Behavioral\Command\UndoableCommand" target="\DesignPatterns\Behavioral\Command\Command">
22+
<point x="0.0" y="-25.0" />
23+
<point x="90.0" y="75.0" />
24+
<point x="151.75" y="75.0" />
25+
<point x="-27.0" y="25.0" />
26+
</edge>
27+
<edge source="\DesignPatterns\Behavioral\Command\AddMessageDateCommand" target="\DesignPatterns\Behavioral\Command\UndoableCommand">
28+
<point x="0.0" y="-59.0" />
29+
<point x="0.0" y="25.0" />
30+
</edge>
31+
</edges>
32+
<settings layout="Hierarchic Group" zoom="1.0" x="145.0" y="200.5" />
33+
<SelectedNodes />
34+
<Categories>
35+
<Category>Fields</Category>
36+
<Category>Constants</Category>
37+
<Category>Constructors</Category>
38+
<Category>Methods</Category>
39+
</Categories>
40+
<VISIBILITY>private</VISIBILITY>
41+
</Diagram>
42+

Behavioral/Command/uml/uml.png

65.4 KB
Loading

0 commit comments

Comments
 (0)