Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Commit

Permalink
Merge pull request #13 from rpasing/master
Browse files Browse the repository at this point in the history
Mode  of Generator::ircMode() and GeneratorInterface::ircMode() optional
  • Loading branch information
elazar committed Jul 16, 2015
2 parents 6df0832 + 1ed6962 commit d333d7e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ public function ircPart($channels, $message = null)
* Returns a MODE message.
*
* @param string $target
* @param string $mode
* @param string $param
* @param string|null $mode
* @param string|null $param
* @return string
*/
public function ircMode($target, $mode, $param = null)
public function ircMode($target, $mode = null, $param = null)
{
return $this->getIrcMessage('MODE', array($target, $mode, $param));
}
Expand Down
6 changes: 3 additions & 3 deletions src/GeneratorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ public function ircPart($channels, $message = null);
* Returns a MODE message.
*
* @param string $target
* @param string $mode
* @param string $param
* @param string|null $mode
* @param string|null $param
* @return string
* @link https://tools.ietf.org/html/rfc2812#section-4.2.3
*/
public function ircMode($target, $mode, $param = null);
public function ircMode($target, $mode = null, $param = null);

/**
* Returns a TOPIC message.
Expand Down
1 change: 1 addition & 0 deletions tests/GeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public function dataProviderTestGenerationMethod()
array('ircMode', "MODE #channel :-s\r\n", array('#channel', '-s')),
array('ircMode', "MODE #channel l :2\r\n", array('#channel', 'l', '2')),
array('ircMode', "MODE nickname :+i\r\n", array('nickname', '+i')),
array('ircMode', "MODE :#channel\r\n", array('#channel')),

array('ircTopic', "TOPIC :#channel\r\n", array('#channel')),
array('ircTopic', "TOPIC #channel :topic\r\n", array('#channel', 'topic')),
Expand Down

0 comments on commit d333d7e

Please sign in to comment.