diff --git a/composer.json b/composer.json index 495c028..f43c6de 100644 --- a/composer.json +++ b/composer.json @@ -11,8 +11,8 @@ }, "require": { "php": ">=5.4.2", - "phergie/phergie-irc-client-react": "~2.1", - "phergie/phergie-irc-connection": "~1.0", + "phergie/phergie-irc-client-react": "~2.2", + "phergie/phergie-irc-connection": "~2.0", "phergie/phergie-irc-event": "~1.0", "evenement/evenement": "~2.0", "monolog/monolog": "~1.6" diff --git a/composer.lock b/composer.lock index 25447c2..c71829f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "93ce92a9c6c858effb4408bda129ca9b", + "hash": "dbffe576d1169609d94317d141d59daf", "packages": [ { "name": "evenement/evenement", @@ -127,35 +127,35 @@ }, { "name": "phergie/phergie-irc-client-react", - "version": "2.1.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/phergie/phergie-irc-client-react.git", - "reference": "bdeeeaeda225118bf6292d85e33c150d097fdfcf" + "reference": "a947bea50b5283c50328dabb9140a97af65c7968" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phergie/phergie-irc-client-react/zipball/bdeeeaeda225118bf6292d85e33c150d097fdfcf", - "reference": "bdeeeaeda225118bf6292d85e33c150d097fdfcf", + "url": "https://api.github.com/repos/phergie/phergie-irc-client-react/zipball/a947bea50b5283c50328dabb9140a97af65c7968", + "reference": "a947bea50b5283c50328dabb9140a97af65c7968", "shasum": "" }, "require": { "monolog/monolog": "~1.6", - "phergie/phergie-irc-connection": "1.*", + "phergie/phergie-irc-connection": "~2.0", "phergie/phergie-irc-generator": "~1.5", - "phergie/phergie-irc-parser": "~1.6", + "phergie/phergie-irc-parser": "~2.0", "php": ">=5.4.2", "psr/log": "~1.0", - "react/dns": "0.4.*", - "react/event-loop": "0.4.*", + "react/dns": "~0.4.0", + "react/event-loop": "~0.4.0", "react/promise": "~2.0", "react/socket-client": "~0.4.2", "react/stream": "~0.4.2" }, "require-dev": { "codeclimate/php-test-reporter": "~0.1", - "phake/phake": "2.0.0-beta2", - "phpunit/phpunit": "4.1.*", + "phake/phake": "~2.1", + "phpunit/phpunit": "~4.6", "satooshi/php-coveralls": "0.6.1", "symfony/config": "~2.0", "symfony/console": "~2.0", @@ -188,27 +188,27 @@ "issues": "https://github.com/phergie/phergie-irc-client-react/issues", "source": "https://github.com/phergie/phergie-irc-client-react" }, - "time": "2015-03-29 19:39:45" + "time": "2015-06-08 23:02:11" }, { "name": "phergie/phergie-irc-connection", - "version": "1.3.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/phergie/phergie-irc-connection.git", - "reference": "a17ff8ffb67a765df3f29bdd9eda138e7ef511ff" + "reference": "c5aa9188693d7ac86dc4842f4dde3d63a523f741" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phergie/phergie-irc-connection/zipball/a17ff8ffb67a765df3f29bdd9eda138e7ef511ff", - "reference": "a17ff8ffb67a765df3f29bdd9eda138e7ef511ff", + "url": "https://api.github.com/repos/phergie/phergie-irc-connection/zipball/c5aa9188693d7ac86dc4842f4dde3d63a523f741", + "reference": "c5aa9188693d7ac86dc4842f4dde3d63a523f741", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.4.2" }, "require-dev": { - "phpunit/phpunit": "4.1.*" + "phpunit/phpunit": "~4.6" }, "type": "library", "autoload": { @@ -237,24 +237,24 @@ "issues": "https://github.com/phergie/phergie-irc-connection/issues", "source": "https://github.com/phergie/phergie-irc-connection" }, - "time": "2015-05-05 01:35:40" + "time": "2015-05-26 15:14:31" }, { "name": "phergie/phergie-irc-event", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/phergie/phergie-irc-event.git", - "reference": "9f58af2ccf3ed95a54f70f012bf48915865d24eb" + "reference": "bccc65cd6371ed441984d23713cfbe197245b677" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phergie/phergie-irc-event/zipball/9f58af2ccf3ed95a54f70f012bf48915865d24eb", - "reference": "9f58af2ccf3ed95a54f70f012bf48915865d24eb", + "url": "https://api.github.com/repos/phergie/phergie-irc-event/zipball/bccc65cd6371ed441984d23713cfbe197245b677", + "reference": "bccc65cd6371ed441984d23713cfbe197245b677", "shasum": "" }, "require": { - "phergie/phergie-irc-connection": "1.*", + "phergie/phergie-irc-connection": "2.*", "php": ">=5.3.3" }, "require-dev": { @@ -286,20 +286,20 @@ "issues": "https://github.com/phergie/phergie-irc-event/issues", "source": "https://github.com/phergie/phergie-irc-event" }, - "time": "2015-03-30 12:58:55" + "time": "2015-06-09 17:45:15" }, { "name": "phergie/phergie-irc-generator", - "version": "1.5.0", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/phergie/phergie-irc-generator.git", - "reference": "cf8b2ea51fb4e35b55f9cced432debdc12984190" + "reference": "6df0832ea8b59eb12a4fe14d59698d0c4aa2e198" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phergie/phergie-irc-generator/zipball/cf8b2ea51fb4e35b55f9cced432debdc12984190", - "reference": "cf8b2ea51fb4e35b55f9cced432debdc12984190", + "url": "https://api.github.com/repos/phergie/phergie-irc-generator/zipball/6df0832ea8b59eb12a4fe14d59698d0c4aa2e198", + "reference": "6df0832ea8b59eb12a4fe14d59698d0c4aa2e198", "shasum": "" }, "require": { @@ -323,27 +323,27 @@ "generator", "irc" ], - "time": "2015-03-28 21:43:04" + "time": "2015-06-08 22:32:36" }, { "name": "phergie/phergie-irc-parser", - "version": "1.6.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/phergie/phergie-irc-parser.git", - "reference": "d233d03f6a24ff8f891de28b6d11cb8410beb315" + "reference": "d7dd26a724576d92e10eb7cdb7218755ed2ae108" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phergie/phergie-irc-parser/zipball/d233d03f6a24ff8f891de28b6d11cb8410beb315", - "reference": "d233d03f6a24ff8f891de28b6d11cb8410beb315", + "url": "https://api.github.com/repos/phergie/phergie-irc-parser/zipball/d7dd26a724576d92e10eb7cdb7218755ed2ae108", + "reference": "d7dd26a724576d92e10eb7cdb7218755ed2ae108", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.4.2" }, "require-dev": { - "phpunit/phpunit": "4.1.*" + "phpunit/phpunit": "~4.6" }, "type": "library", "autoload": { @@ -360,7 +360,7 @@ "irc", "parser" ], - "time": "2015-03-30 17:53:50" + "time": "2015-05-22 00:07:09" }, { "name": "psr/log", @@ -1070,16 +1070,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "2.0.17", + "version": "2.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c4e8e7725e351184a76544634855b8a9c405a6e3" + "reference": "be2286cb8c7e1773eded49d9719219e6f74f9e3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c4e8e7725e351184a76544634855b8a9c405a6e3", - "reference": "c4e8e7725e351184a76544634855b8a9c405a6e3", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/be2286cb8c7e1773eded49d9719219e6f74f9e3e", + "reference": "be2286cb8c7e1773eded49d9719219e6f74f9e3e", "shasum": "" }, "require": { @@ -1102,7 +1102,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.1.x-dev" } }, "autoload": { @@ -1128,7 +1128,7 @@ "testing", "xunit" ], - "time": "2015-05-25 05:11:59" + "time": "2015-06-09 13:05:42" }, { "name": "phpunit/php-file-iterator", @@ -1316,16 +1316,16 @@ }, { "name": "phpunit/phpunit", - "version": "4.6.7", + "version": "4.7.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "57bf06dd4eebe2a5ced79a8de71509e7d5c18b25" + "reference": "8e0c63329c8c4185296b8d357daa5c6bae43080f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/57bf06dd4eebe2a5ced79a8de71509e7d5c18b25", - "reference": "57bf06dd4eebe2a5ced79a8de71509e7d5c18b25", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8e0c63329c8c4185296b8d357daa5c6bae43080f", + "reference": "8e0c63329c8c4185296b8d357daa5c6bae43080f", "shasum": "" }, "require": { @@ -1336,7 +1336,7 @@ "ext-spl": "*", "php": ">=5.3.3", "phpspec/prophecy": "~1.3,>=1.3.1", - "phpunit/php-code-coverage": "~2.0,>=2.0.11", + "phpunit/php-code-coverage": "~2.1", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", "phpunit/php-timer": "~1.0", @@ -1358,7 +1358,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.6.x-dev" + "dev-master": "4.7.x-dev" } }, "autoload": { @@ -1384,20 +1384,20 @@ "testing", "xunit" ], - "time": "2015-05-25 05:18:18" + "time": "2015-06-06 08:36:08" }, { "name": "phpunit/phpunit-mock-objects", - "version": "2.3.1", + "version": "2.3.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "74ffb87f527f24616f72460e54b595f508dccb5c" + "reference": "253c005852591fd547fc18cd5b7b43a1ec82d8f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/74ffb87f527f24616f72460e54b595f508dccb5c", - "reference": "74ffb87f527f24616f72460e54b595f508dccb5c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/253c005852591fd547fc18cd5b7b43a1ec82d8f7", + "reference": "253c005852591fd547fc18cd5b7b43a1ec82d8f7", "shasum": "" }, "require": { @@ -1439,7 +1439,7 @@ "mock", "xunit" ], - "time": "2015-04-02 05:36:41" + "time": "2015-05-29 05:19:18" }, { "name": "satooshi/php-coveralls", @@ -1882,21 +1882,20 @@ }, { "name": "symfony/config", - "version": "v2.6.8", - "target-dir": "Symfony/Component/Config", + "version": "v2.7.0", "source": { "type": "git", "url": "https://github.com/symfony/Config.git", - "reference": "2696c5bc7c31485a482c10865d713de9fcc7aa31" + "reference": "537e9912063e66aa70cbcddd7d6e6e8db61d98e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Config/zipball/2696c5bc7c31485a482c10865d713de9fcc7aa31", - "reference": "2696c5bc7c31485a482c10865d713de9fcc7aa31", + "url": "https://api.github.com/repos/symfony/Config/zipball/537e9912063e66aa70cbcddd7d6e6e8db61d98e4", + "reference": "537e9912063e66aa70cbcddd7d6e6e8db61d98e4", "shasum": "" }, "require": { - "php": ">=5.3.3", + "php": ">=5.3.9", "symfony/filesystem": "~2.3" }, "require-dev": { @@ -1905,11 +1904,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev" + "dev-master": "2.7-dev" } }, "autoload": { - "psr-0": { + "psr-4": { "Symfony\\Component\\Config\\": "" } }, @@ -1929,25 +1928,24 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2015-05-15 13:32:45" + "time": "2015-05-15 13:33:16" }, { "name": "symfony/console", - "version": "v2.6.8", - "target-dir": "Symfony/Component/Console", + "version": "v2.7.0", "source": { "type": "git", "url": "https://github.com/symfony/Console.git", - "reference": "2343f6d8026306bd330e0c987e4c102483c213e7" + "reference": "7f0bec04961c61c961df0cb8c2ae88dbfd83f399" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/2343f6d8026306bd330e0c987e4c102483c213e7", - "reference": "2343f6d8026306bd330e0c987e4c102483c213e7", + "url": "https://api.github.com/repos/symfony/Console/zipball/7f0bec04961c61c961df0cb8c2ae88dbfd83f399", + "reference": "7f0bec04961c61c961df0cb8c2ae88dbfd83f399", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.9" }, "require-dev": { "psr/log": "~1.0", @@ -1963,11 +1961,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev" + "dev-master": "2.7-dev" } }, "autoload": { - "psr-0": { + "psr-4": { "Symfony\\Component\\Console\\": "" } }, @@ -1987,25 +1985,24 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2015-05-22 14:53:08" + "time": "2015-05-29 16:22:24" }, { "name": "symfony/event-dispatcher", - "version": "v2.6.8", - "target-dir": "Symfony/Component/EventDispatcher", + "version": "v2.7.0", "source": { "type": "git", "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "672593bc4b0043a0acf91903bb75a1c82d8f2e02" + "reference": "687039686d0e923429ba6e958d0baa920cd5d458" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/672593bc4b0043a0acf91903bb75a1c82d8f2e02", - "reference": "672593bc4b0043a0acf91903bb75a1c82d8f2e02", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/687039686d0e923429ba6e958d0baa920cd5d458", + "reference": "687039686d0e923429ba6e958d0baa920cd5d458", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.9" }, "require-dev": { "psr/log": "~1.0", @@ -2022,11 +2019,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev" + "dev-master": "2.7-dev" } }, "autoload": { - "psr-0": { + "psr-4": { "Symfony\\Component\\EventDispatcher\\": "" } }, @@ -2046,25 +2043,24 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2015-05-02 15:18:45" + "time": "2015-05-02 15:21:08" }, { "name": "symfony/filesystem", - "version": "v2.6.8", - "target-dir": "Symfony/Component/Filesystem", + "version": "v2.7.0", "source": { "type": "git", "url": "https://github.com/symfony/Filesystem.git", - "reference": "1f8429f72a5bfa58b33fd96824bea146fc4b3f49" + "reference": "ae4551fd6d4d4f51f2e7390fbc902fbd67f3b7ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Filesystem/zipball/1f8429f72a5bfa58b33fd96824bea146fc4b3f49", - "reference": "1f8429f72a5bfa58b33fd96824bea146fc4b3f49", + "url": "https://api.github.com/repos/symfony/Filesystem/zipball/ae4551fd6d4d4f51f2e7390fbc902fbd67f3b7ba", + "reference": "ae4551fd6d4d4f51f2e7390fbc902fbd67f3b7ba", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.9" }, "require-dev": { "symfony/phpunit-bridge": "~2.7" @@ -2072,11 +2068,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev" + "dev-master": "2.7-dev" } }, "autoload": { - "psr-0": { + "psr-4": { "Symfony\\Component\\Filesystem\\": "" } }, @@ -2096,25 +2092,24 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2015-05-15 13:32:45" + "time": "2015-05-15 13:33:16" }, { "name": "symfony/stopwatch", - "version": "v2.6.8", - "target-dir": "Symfony/Component/Stopwatch", + "version": "v2.7.0", "source": { "type": "git", "url": "https://github.com/symfony/Stopwatch.git", - "reference": "b470f87c69837cb71115f1fa720388bb19b63635" + "reference": "7702945bceddc0e1f744519abb8a2baeb94bd5ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/b470f87c69837cb71115f1fa720388bb19b63635", - "reference": "b470f87c69837cb71115f1fa720388bb19b63635", + "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/7702945bceddc0e1f744519abb8a2baeb94bd5ce", + "reference": "7702945bceddc0e1f744519abb8a2baeb94bd5ce", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.9" }, "require-dev": { "symfony/phpunit-bridge": "~2.7" @@ -2122,11 +2117,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev" + "dev-master": "2.7-dev" } }, "autoload": { - "psr-0": { + "psr-4": { "Symfony\\Component\\Stopwatch\\": "" } }, @@ -2146,25 +2141,24 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2015-05-02 15:18:45" + "time": "2015-05-02 15:21:08" }, { "name": "symfony/yaml", - "version": "v2.6.8", - "target-dir": "Symfony/Component/Yaml", + "version": "v2.7.0", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "f157ab074e453ecd4c0fa775f721f6e67a99d9e2" + "reference": "4a29a5248aed4fb45f626a7bbbd330291492f5c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/f157ab074e453ecd4c0fa775f721f6e67a99d9e2", - "reference": "f157ab074e453ecd4c0fa775f721f6e67a99d9e2", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/4a29a5248aed4fb45f626a7bbbd330291492f5c3", + "reference": "4a29a5248aed4fb45f626a7bbbd330291492f5c3", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.9" }, "require-dev": { "symfony/phpunit-bridge": "~2.7" @@ -2172,11 +2166,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev" + "dev-master": "2.7-dev" } }, "autoload": { - "psr-0": { + "psr-4": { "Symfony\\Component\\Yaml\\": "" } }, @@ -2196,7 +2190,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2015-05-02 15:18:45" + "time": "2015-05-02 15:21:08" } ], "aliases": [], diff --git a/src/EventQueue.php b/src/EventQueue.php index 32fd8ac..f4a0fe0 100644 --- a/src/EventQueue.php +++ b/src/EventQueue.php @@ -472,10 +472,10 @@ public function ircWho($name, $o = null) /** * Implements \Phergie\Irc\GeneratorInterface->ircWhois(). * - * @param string $server * @param string $nickmasks + * @param string $server Optional */ - public function ircWhois($server, $nickmasks) + public function ircWhois($nickmasks, $server = null) { $this->queueIrcRequest('WHOIS', array($server, $nickmasks)); } diff --git a/tests/EventQueueTest.php b/tests/EventQueueTest.php index 8eebc4c..00f31a9 100644 --- a/tests/EventQueueTest.php +++ b/tests/EventQueueTest.php @@ -37,21 +37,26 @@ protected function setUp() /** * Tests the queue with IRC events. + * $event_params is the same as $params if set to null. * * @param string $method * @param string $command * @param array $params + * @param array|null $event_params * @param string|null $prefix * @dataProvider dataProviderIrcEvents */ - public function testIrcEvents($method, $command, array $params = array(), $prefix = null) + public function testIrcEvents($method, $command, array $params = array(), array $event_params = null, $prefix = null) { + if ($event_params == null) { + $event_params = $params; + } $this->queue->setPrefix($prefix); call_user_func_array(array($this->queue, $method), $params); $event = $this->queue->extract(); $this->assertInstanceOf('\Phergie\Irc\Event\UserEvent', $event); $this->assertSame($command, $event->getCommand()); - $this->assertSame($params, $event->getParams()); + $this->assertSame($event_params, $event->getParams()); $this->assertSame($prefix, $event->getPrefix()); } @@ -89,7 +94,7 @@ public function dataProviderIrcEvents() array('ircPrivmsg', 'PRIVMSG', array('receivers', 'text')), array('ircNotice', 'NOTICE', array('nickname', 'text')), array('ircWho', 'WHO', array('name', 'o')), - array('ircWhois', 'WHOIS', array('server', 'nickmasks')), + array('ircWhois', 'WHOIS', array('nickmasks', 'server'), array('server', 'nickmasks')), array('ircWhowas', 'WHOWAS', array('nickname', 'count', 'server')), array('ircKill', 'KILL', array('nickname', 'comment')), array('ircPing', 'PING', array('server1', 'server2')), @@ -107,8 +112,11 @@ public function dataProviderIrcEvents() ); foreach ($data as $value) { - if (!is_array(end($value))) { + if (count($value) == 2) { $value[] = array(); + $value[] = null; + } elseif (count($value) == 3) { + $value[] = null; } $value[] = 'prefix'; $data[] = $value;