Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3e515da

Browse files
Behavioral\Command restructured
1 parent e59d70a commit 3e515da

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

Behavioral/Command/CommandInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace DesignPatterns\Command;
3+
namespace DesignPatterns\Behavioral\Command;
44

55
/**
66
* class CommandInterface

Behavioral/Command/HelloCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace DesignPatterns\Command;
3+
namespace DesignPatterns\Behavioral\Command;
44

55
/**
66
* This concrete command calls "print" on the Receiver, but an external

Behavioral/Command/Invoker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace DesignPatterns\Command;
3+
namespace DesignPatterns\Behavioral\Command;
44

55
/**
66
* Invoker is using the command given to it.

Behavioral/Command/Receiver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace DesignPatterns\Command;
3+
namespace DesignPatterns\Behavioral\Command;
44

55
/**
66
* Receiver is specific service with its own contract and can be only concrete

Behavioral/Command/Test/CommandTest.php renamed to Behavioral/Command/Tests/CommandTest.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
<?php
22

3-
namespace DesignPatterns\Tests\Command;
3+
namespace DesignPatterns\Behavioral\Command\Tests;
44

5-
use DesignPatterns\Command\Invoker;
6-
use DesignPatterns\Command\Receiver;
7-
use DesignPatterns\Command\HelloCommand;
5+
use DesignPatterns\Behavioral\Command\Invoker;
6+
use DesignPatterns\Behavioral\Command\Receiver;
7+
use DesignPatterns\Behavioral\Command\HelloCommand;
88

99
/**
1010
* CommandTest has the role of the Client in the Command Pattern
1111
*/
1212
class CommandTest extends \PHPUnit_Framework_TestCase
1313
{
1414

15+
/**
16+
* @var Invoker
17+
*/
1518
protected $invoker;
19+
20+
/**
21+
* @var Receiver
22+
*/
1623
protected $receiver;
1724

1825
protected function setUp()
1926
{
20-
// this is the context of the application
2127
$this->invoker = new Invoker();
2228
$this->receiver = new Receiver();
2329
}

0 commit comments

Comments
 (0)