Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/CommandRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ public function getDevice(): InterfaceDevice
}

/**
* @param $command
* @param string $type
* @param InterfaceCommand $command
* @param string $type
*/
public function setCommand($command, string $type): void
public function setCommand(InterfaceCommand $command, string $type): void
{
$this->commandsRegistry[$type] = $command;
}
Expand Down
26 changes: 26 additions & 0 deletions src/InterfaceCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
/**
* Date: 21.02.18
* Time: 23:45
*
* @author : Korotkov Danila <dankorot@gmail.com>
* @copyright Copyright (c) 2018, Korotkov Danila
* @license http://www.gnu.org/licenses/gpl.html GNU GPLv3.0
*/

namespace Behavioral\Command;


/**
* Interface InterfaceCommand
* @package Behavioral\Command
*/
interface InterfaceCommand
{

/**
* @param InterfaceDevice $device
* @return mixed
*/
public function execute(InterfaceDevice $device);
}
2 changes: 1 addition & 1 deletion src/ToggleCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Class ToggleCommand
* @package Behavioral\Command
*/
class ToggleCommand
class ToggleCommand implements InterfaceCommand
{
/**
* @return int
Expand Down
2 changes: 1 addition & 1 deletion src/TurnOffCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Class TurnOffCommand
* @package Behavioral\Command
*/
class TurnOffCommand
class TurnOffCommand implements InterfaceCommand
{

/**
Expand Down
2 changes: 1 addition & 1 deletion src/TurnOnCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Class TurnOnCommand
* @package Behavioral\Command
*/
class TurnOnCommand
class TurnOnCommand implements InterfaceCommand
{

/**
Expand Down