From 8e31fa59c62bb0ff7f07aaaaff03a2c5b6c08089 Mon Sep 17 00:00:00 2001 From: Adrian Brown Date: Mon, 11 Feb 2019 13:37:59 +1100 Subject: [PATCH 01/14] Upgrade to React Sockets 1.1. --- composer.json | 4 +-- src/Client.php | 50 ++++++++++++++------------ src/Factory.php | 45 ++++++++++++++--------- src/Io/InputStream.php | 35 ------------------ src/Io/InputStreamInterface.php | 13 ------- src/Io/OutputStream.php | 61 -------------------------------- src/Io/OutputStreamInterface.php | 17 --------- 7 files changed, 59 insertions(+), 166 deletions(-) delete mode 100644 src/Io/InputStream.php delete mode 100644 src/Io/InputStreamInterface.php delete mode 100644 src/Io/OutputStream.php delete mode 100644 src/Io/OutputStreamInterface.php diff --git a/composer.json b/composer.json index 202c286..9abd311 100644 --- a/composer.json +++ b/composer.json @@ -6,8 +6,8 @@ "require": { "php": ">=5.4", "evenement/evenement": "~2.0", - "react/socket": "0.4.*", - "react/promise": "~2.0" + "react/socket": "^1.1", + "react/promise": "^2.2.1" }, "autoload": { "psr-4": { "React\\Stomp\\": "src" } diff --git a/src/Client.php b/src/Client.php index 073d87c..ce7d4fb 100644 --- a/src/Client.php +++ b/src/Client.php @@ -4,20 +4,19 @@ use Evenement\EventEmitter; use React\Promise\Deferred; -use React\Promise\PromiseInterface; -use React\Stomp\Client\IncomingPackageProcessor; -use React\Stomp\Client\OutgoingPackageCreator; use React\Stomp\Client\State; -use React\Stomp\Client\Command\CommandInterface; -use React\Stomp\Client\Command\CloseCommand; -use React\Stomp\Client\Command\ConnectionEstablishedCommand; -use React\Stomp\Client\Command\NullCommand; -use React\Stomp\Exception\ProcessingException; -use React\Stomp\Exception\ConnectionException; -use React\Stomp\Io\InputStreamInterface; -use React\Stomp\Io\OutputStreamInterface; use React\Stomp\Protocol\Frame; use React\EventLoop\LoopInterface; +use React\Stream\ReadableStreamInterface; +use React\Stream\WritableStreamInterface; +use React\Stomp\Client\Command\NullCommand; +use React\Stomp\Client\Command\CloseCommand; +use React\Stomp\Client\OutgoingPackageCreator; +use React\Stomp\Exception\ConnectionException; +use React\Stomp\Exception\ProcessingException; +use React\Stomp\Client\Command\CommandInterface; +use React\Stomp\Client\IncomingPackageProcessor; +use React\Stomp\Client\Command\ConnectionEstablishedCommand; /** * @event connect @@ -39,7 +38,7 @@ class Client extends EventEmitter /** @var PromiseInterface */ private $connectPromise; - public function __construct(LoopInterface $loop, InputStreamInterface $input, OutputStreamInterface $output, array $options) + public function __construct(LoopInterface $loop, WritableStreamInterface $input, ReadableStreamInterface $output, array $options) { $this->loop = $loop; $state = new State(); @@ -61,7 +60,7 @@ public function connect($timeout = 5) return $this->connectPromise; } - $this->connectionStatus = 'connecting'; + $this->setConnectionStatus('connecting'); $deferred = $this->connectDeferred = new Deferred(); $client = $this; @@ -73,7 +72,7 @@ public function connect($timeout = 5) }); $this->on('connect', function ($client) use ($timer, $deferred) { - $timer->cancel(); + $this->loop->cancelTimer($timer); $deferred->resolve($client); }); @@ -82,7 +81,7 @@ public function connect($timeout = 5) $this->options['login'], $this->options['passcode'] ); - $this->output->sendFrame($frame); + $this->sendFrameToOutput($frame); return $this->connectPromise = $deferred->promise()->then(function () use ($client) { $client->setConnectionStatus('connected'); @@ -90,10 +89,15 @@ public function connect($timeout = 5) }); } + private function sendFrameToOutput(Frame $frame) + { + $this->output->emit('data', [(string) $frame]); + } + public function send($destination, $body, array $headers = array()) { $frame = $this->packageCreator->send($destination, $body, $headers); - $this->output->sendFrame($frame); + $this->sendFrameToOutput($frame); } public function subscribe($destination, $callback, array $headers = array()) @@ -112,7 +116,7 @@ public function subscribeWithAck($destination, $ack, $callback, array $headers = private function doSubscription($destination, $callback, $ack, array $headers) { $frame = $this->packageCreator->subscribe($destination, $ack, $headers); - $this->output->sendFrame($frame); + $this->sendFrameToOutput($frame); $subscriptionId = $frame->getHeader('id'); @@ -125,7 +129,7 @@ private function doSubscription($destination, $callback, $ack, array $headers) public function unsubscribe($subscriptionId, array $headers = array()) { $frame = $this->packageCreator->unsubscribe($subscriptionId, $headers); - $this->output->sendFrame($frame); + $this->sendFrameToOutput($frame); unset($this->acknowledgements[$subscriptionId]); unset($this->subscriptions[$subscriptionId]); @@ -134,20 +138,20 @@ public function unsubscribe($subscriptionId, array $headers = array()) public function ack($subscriptionId, $messageId, array $headers = array()) { $frame = $this->packageCreator->ack($subscriptionId, $messageId, $headers); - $this->output->sendFrame($frame); + $this->sendFrameToOutput($frame); } public function nack($subscriptionId, $messageId, array $headers = array()) { $frame = $this->packageCreator->nack($subscriptionId, $messageId, $headers); - $this->output->sendFrame($frame); + $this->sendFrameToOutput($frame); } public function disconnect() { $receipt = $this->generateReceiptId(); $frame = $this->packageCreator->disconnect($receipt); - $this->output->sendFrame($frame); + $this->sendFrameToOutput($frame); $this->connectDeferred = null; $this->connectPromise = null; @@ -163,6 +167,7 @@ public function resetConnectDeferred() public function handleFrameEvent(Frame $frame) { try { + $this->emit('frame', [$frame]); $this->processFrame($frame); } catch (ProcessingException $e) { $this->emit('error', array($e)); @@ -261,11 +266,12 @@ public function isConnected() public function setConnectionStatus($status) { $this->connectionStatus = $status; + + $this->emit('connection-status', [$this->connectionStatus]); } public function generateReceiptId() { return mt_rand(); } - } diff --git a/src/Factory.php b/src/Factory.php index d805661..4f8c703 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -2,12 +2,13 @@ namespace React\Stomp; +use React\Socket\Connection; +use React\Stream\ThroughStream; +use React\Stomp\Protocol\Parser; use React\EventLoop\LoopInterface; +use React\Stream\ReadableResourceStream; +use React\Stream\WritableResourceStream; use React\Stomp\Exception\ConnectionException; -use React\Stomp\Io\InputStream; -use React\Stomp\Io\OutputStream; -use React\Stomp\Protocol\Parser; -use React\Socket\Connection; class Factory { @@ -26,23 +27,35 @@ public function __construct(LoopInterface $loop) $this->loop = $loop; } - public function createClient(array $options = array()) + public function createClient(array $options = array(), bool $silent = false) { $options = array_merge($this->defaultOptions, $options); - $conn = $this->createConnection($options); + $connection = $this->createConnection($options); - $parser = new Parser(); - $input = new InputStream($parser); - $conn->pipe($input); + $input = new WritableResourceStream(STDOUT, $this->loop); + $output = new ReadableResourceStream(STDIN, $this->loop); - $output = new OutputStream($this->loop); - $output->pipe($conn); + $output->pipe($connection); + if ($silent === false) { + $connection->pipe($input); + } - $conn->on('error', function ($e) use ($input) { - $input->emit('error', array($e)); + $connection->pipe(new ThroughStream(function ($data) use ($input) { + $parser = new Parser(); + + [$frames, $data] = $parser->parse($data); + + foreach ($frames as $frame) { + $input->emit('frame', [$frame]); + } + })); + + $connection->on('error', function ($error) use ($input) { + $input->emit('error', [$error]); }); - $conn->on('close', function () use ($input) { + + $connection->on('close', function () use ($input) { $input->emit('close'); }); @@ -58,8 +71,8 @@ public function createConnection($options) throw new ConnectionException($message, $errno); } - $conn = new Connection($fd, $this->loop); + $connection = new Connection($fd, $this->loop); - return $conn; + return $connection; } } diff --git a/src/Io/InputStream.php b/src/Io/InputStream.php deleted file mode 100644 index 907c206..0000000 --- a/src/Io/InputStream.php +++ /dev/null @@ -1,35 +0,0 @@ -on('frame', function ($frame) { -// lulz -// }); -// $conn->pipe($input); - -class InputStream extends WritableStream implements InputStreamInterface -{ - private $buffer = ''; - private $parser; - - public function __construct(Parser $parser) - { - $this->parser = $parser; - } - - public function write($data) - { - $data = $this->buffer.$data; - list($frames, $data) = $this->parser->parse($data); - $this->buffer = $data; - - foreach ($frames as $frame) { - $this->emit('frame', array($frame)); - } - } -} diff --git a/src/Io/InputStreamInterface.php b/src/Io/InputStreamInterface.php deleted file mode 100644 index aca410d..0000000 --- a/src/Io/InputStreamInterface.php +++ /dev/null @@ -1,13 +0,0 @@ -pipe($conn); -// $output->sendFrame($frame); - -class OutputStream extends ReadableStream implements OutputStreamInterface -{ - private $loop; - private $paused = false; - private $bufferedFrames = array(); - - public function __construct(LoopInterface $loop) - { - $this->loop = $loop; - } - - public function sendFrame(Frame $frame) - { - if ($this->paused) { - $this->bufferedFrames[] = $frame; - return; - } - - $data = (string) $frame; - $this->emit('data', array($data)); - } - - public function pause() - { - $this->paused = true; - } - - public function resume() - { - $this->paused = false; - - $this->loop->addTimer(0.001, array($this, 'sendBufferedFrames')); - } - - public function sendBufferedFrames() - { - if ($this->paused) { - return; - } - - while ($frame = array_shift($this->bufferedFrames)) { - $this->sendFrame($frame); - - if ($this->paused) { - return; - } - } - } -} diff --git a/src/Io/OutputStreamInterface.php b/src/Io/OutputStreamInterface.php deleted file mode 100644 index 5bd46ff..0000000 --- a/src/Io/OutputStreamInterface.php +++ /dev/null @@ -1,17 +0,0 @@ - Date: Mon, 11 Feb 2019 15:25:54 +1100 Subject: [PATCH 02/14] Add FrameBuffer class to pull frames only when fully received. --- src/Factory.php | 9 ++++----- src/FrameBuffer.php | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 src/FrameBuffer.php diff --git a/src/Factory.php b/src/Factory.php index 4f8c703..8994d2f 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -3,8 +3,8 @@ namespace React\Stomp; use React\Socket\Connection; +use React\Stomp\FrameBuffer; use React\Stream\ThroughStream; -use React\Stomp\Protocol\Parser; use React\EventLoop\LoopInterface; use React\Stream\ReadableResourceStream; use React\Stream\WritableResourceStream; @@ -33,6 +33,7 @@ public function createClient(array $options = array(), bool $silent = false) $connection = $this->createConnection($options); + $frameBuffer = new FrameBuffer; $input = new WritableResourceStream(STDOUT, $this->loop); $output = new ReadableResourceStream(STDIN, $this->loop); @@ -41,10 +42,8 @@ public function createClient(array $options = array(), bool $silent = false) $connection->pipe($input); } - $connection->pipe(new ThroughStream(function ($data) use ($input) { - $parser = new Parser(); - - [$frames, $data] = $parser->parse($data); + $connection->pipe(new ThroughStream(function ($data) use ($input, $frameBuffer) { + $frames = $frameBuffer->addToBuffer($data)->pullFrames(); foreach ($frames as $frame) { $input->emit('frame', [$frame]); diff --git a/src/FrameBuffer.php b/src/FrameBuffer.php new file mode 100644 index 0000000..aba8633 --- /dev/null +++ b/src/FrameBuffer.php @@ -0,0 +1,34 @@ +parser = new Parser(); + } + + public function addToBuffer($data) + { + $this->buffer .= $data; + + return $this; + } + + public function pullFrames() + { + $data = $this->buffer; + + list($frames, $data) = $this->parser->parse($data); + + $this->buffer = $data; + + return $frames; + } +} From 32172c63d3284b6d56e492c8735f3420f9460485 Mon Sep 17 00:00:00 2001 From: Adrian Brown Date: Mon, 11 Feb 2019 22:15:55 +1100 Subject: [PATCH 03/14] Fix tests. --- composer.lock | 841 +++++++++++++----- src/Client.php | 2 +- tests/React/Tests/Stomp/ClientTest.php | 380 ++++---- .../Tests/Stomp/Constraint/FrameHasHeader.php | 4 +- .../Tests/Stomp/Constraint/FrameIsEqual.php | 4 +- .../React/Tests/Stomp/Io/InputStreamTest.php | 107 --- .../React/Tests/Stomp/Io/OutputStreamTest.php | 71 -- 7 files changed, 803 insertions(+), 606 deletions(-) delete mode 100644 tests/React/Tests/Stomp/Io/InputStreamTest.php delete mode 100644 tests/React/Tests/Stomp/Io/OutputStreamTest.php diff --git a/composer.lock b/composer.lock index 09dcf27..7b6155b 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,10 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ff2121cc38a06173915aa056aa3b7619", + "content-hash": "8ae7442e52f825d921a077245c79a218", "packages": [ { "name": "evenement/evenement", @@ -54,30 +54,115 @@ ], "time": "2017-07-17T17:39:19+00:00" }, + { + "name": "react/cache", + "version": "v0.5.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/cache.git", + "reference": "7d7da7fb7574d471904ba357b39bbf110ccdbf66" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/cache/zipball/7d7da7fb7574d471904ba357b39bbf110ccdbf66", + "reference": "7d7da7fb7574d471904ba357b39bbf110ccdbf66", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/promise": "~2.0|~1.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Async, Promise-based cache interface for ReactPHP", + "keywords": [ + "cache", + "caching", + "promise", + "reactphp" + ], + "time": "2018-06-25T12:52:40+00:00" + }, + { + "name": "react/dns", + "version": "v0.4.16", + "source": { + "type": "git", + "url": "https://github.com/reactphp/dns.git", + "reference": "0a0bedfec72b38406413c6ea01e1c015bd0bf72b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/dns/zipball/0a0bedfec72b38406413c6ea01e1c015bd0bf72b", + "reference": "0a0bedfec72b38406413c6ea01e1c015bd0bf72b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/cache": "^0.5 || ^0.4 || ^0.3", + "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5", + "react/promise": "^2.1 || ^1.2.1", + "react/promise-timer": "^1.2", + "react/stream": "^1.0 || ^0.7 || ^0.6 || ^0.5 || ^0.4.5" + }, + "require-dev": { + "clue/block-react": "^1.2", + "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Dns\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Async DNS resolver for ReactPHP", + "keywords": [ + "async", + "dns", + "dns-resolver", + "reactphp" + ], + "time": "2018-11-11T11:21:13+00:00" + }, { "name": "react/event-loop", - "version": "v0.4.3", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/reactphp/event-loop.git", - "reference": "8bde03488ee897dc6bb3d91e4e17c353f9c5252f" + "reference": "a0ecac955c67b57c40fe4a1b88a7cca1b58c982d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/event-loop/zipball/8bde03488ee897dc6bb3d91e4e17c353f9c5252f", - "reference": "8bde03488ee897dc6bb3d91e4e17c353f9c5252f", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/a0ecac955c67b57c40fe4a1b88a7cca1b58c982d", + "reference": "a0ecac955c67b57c40fe4a1b88a7cca1b58c982d", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "~4.8" + "phpunit/phpunit": "^7.0 || ^6.4 || ^5.7 || ^4.8.35" }, "suggest": { - "ext-event": "~1.0", - "ext-libev": "*", - "ext-libevent": ">=0.1.0" + "ext-event": "~1.0 for ExtEventLoop", + "ext-pcntl": "For signal handling support when using the StreamSelectLoop", + "ext-uv": "* for ExtUvLoop" }, "type": "library", "autoload": { @@ -89,25 +174,25 @@ "license": [ "MIT" ], - "description": "Event loop abstraction layer that libraries can use for evented I/O.", + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", "keywords": [ "asynchronous", "event-loop" ], - "time": "2017-04-27T10:56:23+00:00" + "time": "2019-02-07T16:19:49+00:00" }, { "name": "react/promise", - "version": "v2.5.1", + "version": "v2.7.1", "source": { "type": "git", "url": "https://github.com/reactphp/promise.git", - "reference": "62785ae604c8d69725d693eb370e1d67e94c4053" + "reference": "31ffa96f8d2ed0341a57848cbb84d88b89dd664d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/62785ae604c8d69725d693eb370e1d67e94c4053", - "reference": "62785ae604c8d69725d693eb370e1d67e94c4053", + "url": "https://api.github.com/repos/reactphp/promise/zipball/31ffa96f8d2ed0341a57848cbb84d88b89dd664d", + "reference": "31ffa96f8d2ed0341a57848cbb84d88b89dd664d", "shasum": "" }, "require": { @@ -140,33 +225,87 @@ "promise", "promises" ], - "time": "2017-03-25T12:08:31+00:00" + "time": "2019-01-07T21:25:54+00:00" + }, + { + "name": "react/promise-timer", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise-timer.git", + "reference": "a11206938ca2394dc7bb368f5da25cd4533fa603" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise-timer/zipball/a11206938ca2394dc7bb368f5da25cd4533fa603", + "reference": "a11206938ca2394dc7bb368f5da25cd4533fa603", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5", + "react/promise": "^2.7.0 || ^1.2.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Promise\\Timer\\": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@lueck.tv" + } + ], + "description": "A trivial implementation of timeouts for Promises, built on top of ReactPHP.", + "homepage": "https://github.com/reactphp/promise-timer", + "keywords": [ + "async", + "event-loop", + "promise", + "reactphp", + "timeout", + "timer" + ], + "time": "2018-06-13T16:45:37+00:00" }, { "name": "react/socket", - "version": "v0.4.6", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/reactphp/socket.git", - "reference": "cf074e53c974df52388ebd09710a9018894745d2" + "reference": "23b7372bb25cea934f6124f5bdac34e30161959e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/cf074e53c974df52388ebd09710a9018894745d2", - "reference": "cf074e53c974df52388ebd09710a9018894745d2", + "url": "https://api.github.com/repos/reactphp/socket/zipball/23b7372bb25cea934f6124f5bdac34e30161959e", + "reference": "23b7372bb25cea934f6124f5bdac34e30161959e", "shasum": "" }, "require": { - "evenement/evenement": "~2.0|~1.0", + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", "php": ">=5.3.0", - "react/event-loop": "0.4.*|0.3.*", - "react/promise": "^2.0 || ^1.1", - "react/stream": "^0.4.5" + "react/dns": "^0.4.13", + "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5", + "react/promise": "^2.6.0 || ^1.2.1", + "react/promise-timer": "^1.4.0", + "react/stream": "^1.1" }, "require-dev": { - "clue/block-react": "^1.1", - "phpunit/phpunit": "~4.8", - "react/socket-client": "^0.5.1" + "clue/block-react": "^1.2", + "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" }, "type": "library", "autoload": { @@ -178,38 +317,38 @@ "license": [ "MIT" ], - "description": "Async, streaming plaintext TCP/IP and secure TLS socket server for React PHP", + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", "keywords": [ - "Socket" + "Connection", + "Socket", + "async", + "reactphp", + "stream" ], - "time": "2017-01-26T09:23:38+00:00" + "time": "2019-01-07T14:10:13+00:00" }, { "name": "react/stream", - "version": "v0.4.6", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/reactphp/stream.git", - "reference": "44dc7f51ea48624110136b535b9ba44fd7d0c1ee" + "reference": "50426855f7a77ddf43b9266c22320df5bf6c6ce6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/stream/zipball/44dc7f51ea48624110136b535b9ba44fd7d0c1ee", - "reference": "44dc7f51ea48624110136b535b9ba44fd7d0c1ee", + "url": "https://api.github.com/repos/reactphp/stream/zipball/50426855f7a77ddf43b9266c22320df5bf6c6ce6", + "reference": "50426855f7a77ddf43b9266c22320df5bf6c6ce6", "shasum": "" }, "require": { - "evenement/evenement": "^2.0|^1.0", - "php": ">=5.3.8" + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5" }, "require-dev": { "clue/stream-filter": "~1.2", - "react/event-loop": "^0.4|^0.3", - "react/promise": "^2.0|^1.0" - }, - "suggest": { - "react/event-loop": "^0.4", - "react/promise": "^2.0" + "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" }, "type": "library", "autoload": { @@ -221,43 +360,49 @@ "license": [ "MIT" ], - "description": "Basic readable and writable stream interfaces that support piping.", + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", "keywords": [ + "event-driven", + "io", + "non-blocking", "pipe", - "stream" + "reactphp", + "readable", + "stream", + "writable" ], - "time": "2017-01-25T14:44:14+00:00" + "time": "2019-01-01T16:15:09+00:00" } ], "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1" }, "require-dev": { "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -282,41 +427,47 @@ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2017-07-22T11:58:36+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.6.1", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102" + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8e6e04167378abf1ddb4d3522d8755c5fd90d102", - "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" }, "require-dev": { - "doctrine/collections": "1.*", - "phpunit/phpunit": "~4.1" + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" }, "type": "library", "autoload": { "psr-4": { "DeepCopy\\": "src/DeepCopy/" - } + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "Create deep copies (clones) of your objects", - "homepage": "https://github.com/myclabs/DeepCopy", "keywords": [ "clone", "copy", @@ -324,20 +475,122 @@ "object", "object graph" ], - "time": "2017-04-12T18:52:22+00:00" + "time": "2018-06-11T23:09:50+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2017-03-05T17:38:23+00:00" }, { "name": "phpdocumentor/reflection-common", - "version": "1.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", "shasum": "" }, "require": { @@ -378,33 +631,39 @@ "reflection", "static analysis" ], - "time": "2015-12-27T11:43:31+00:00" + "time": "2017-09-11T18:02:19+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.2.0", + "version": "4.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "46f7e8bb075036c92695b15a1ddb6971c751e585" + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/46f7e8bb075036c92695b15a1ddb6971c751e585", - "reference": "46f7e8bb075036c92695b15a1ddb6971c751e585", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", "shasum": "" }, "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0@dev", + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, "autoload": { "psr-4": { "phpDocumentor\\Reflection\\": [ @@ -423,7 +682,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-07-15T11:38:20+00:00" + "time": "2017-11-30T07:14:17+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -474,33 +733,33 @@ }, { "name": "phpspec/prophecy", - "version": "v1.7.0", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", - "sebastian/comparator": "^1.1|^2.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8 || ^5.6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.8.x-dev" } }, "autoload": { @@ -533,44 +792,44 @@ "spy", "stub" ], - "time": "2017-03-02T20:05:34+00:00" + "time": "2018-08-05T17:53:17+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "4.0.8", + "version": "5.3.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + "reference": "c89677919c5dd6d3b3852f230a663118762218ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "^1.3", - "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.2 || ^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0", - "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "^1.0 || ^2.0" + "php": "^7.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^2.0.1", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" }, "require-dev": { - "ext-xdebug": "^2.1.4", - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "^6.0" }, "suggest": { - "ext-xdebug": "^2.5.1" + "ext-xdebug": "^2.5.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "5.3.x-dev" } }, "autoload": { @@ -585,7 +844,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -596,20 +855,20 @@ "testing", "xunit" ], - "time": "2017-04-02T07:44:40+00:00" + "time": "2018-04-06T15:36:58+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.2", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", "shasum": "" }, "require": { @@ -643,7 +902,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03T07:40:28+00:00" + "time": "2017-11-27T13:52:08+00:00" }, { "name": "phpunit/php-text-template", @@ -737,29 +996,29 @@ }, { "name": "phpunit/php-token-stream", - "version": "1.4.11", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" + "reference": "791198a2c6254db10131eecfe8c06670700904db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.2.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -782,20 +1041,20 @@ "keywords": [ "tokenizer" ], - "time": "2017-02-27T10:12:30+00:00" + "time": "2017-11-27T05:48:46+00:00" }, { "name": "phpunit/phpunit", - "version": "5.7.23", + "version": "6.5.14", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "78532d5269d984660080d8e0f4c99c5c2ea65ffe" + "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/78532d5269d984660080d8e0f4c99c5c2ea65ffe", - "reference": "78532d5269d984660080d8e0f4c99c5c2ea65ffe", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bac23fe7ff13dbdb461481f706f0e9fe746334b7", + "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7", "shasum": "" }, "require": { @@ -804,33 +1063,35 @@ "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.6.2", - "phpunit/php-code-coverage": "^4.0.4", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "^1.2.4", - "sebastian/diff": "^1.4.3", - "sebastian/environment": "^1.3.4 || ^2.0", - "sebastian/exporter": "~2.0", - "sebastian/global-state": "^1.1", - "sebastian/object-enumerator": "~2.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "~1.0.3|~2.0", - "symfony/yaml": "~2.1|~3.0" + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.0", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^5.3", + "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^5.0.9", + "sebastian/comparator": "^2.1", + "sebastian/diff": "^2.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" }, "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2" + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" }, "require-dev": { "ext-pdo": "*" }, "suggest": { "ext-xdebug": "*", - "phpunit/php-invoker": "~1.1" + "phpunit/php-invoker": "^1.1" }, "bin": [ "phpunit" @@ -838,7 +1099,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.7.x-dev" + "dev-master": "6.5.x-dev" } }, "autoload": { @@ -864,33 +1125,33 @@ "testing", "xunit" ], - "time": "2017-10-15T06:13:55+00:00" + "time": "2019-02-01T05:22:47+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "3.4.4", + "version": "5.0.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2 || ^2.0" + "doctrine/instantiator": "^1.0.5", + "php": "^7.0", + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.1" }, "conflict": { - "phpunit/phpunit": "<5.4.0" + "phpunit/phpunit": "<6.0" }, "require-dev": { - "phpunit/phpunit": "^5.4" + "phpunit/phpunit": "^6.5.11" }, "suggest": { "ext-soap": "*" @@ -898,7 +1159,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2.x-dev" + "dev-master": "5.0.x-dev" } }, "autoload": { @@ -913,7 +1174,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -923,7 +1184,7 @@ "mock", "xunit" ], - "time": "2017-06-30T09:13:00+00:00" + "time": "2018-08-09T05:50:03+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -972,30 +1233,30 @@ }, { "name": "sebastian/comparator", - "version": "1.2.4", + "version": "2.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" + "php": "^7.0", + "sebastian/diff": "^2.0 || ^3.0", + "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "2.1.x-dev" } }, "autoload": { @@ -1026,38 +1287,38 @@ } ], "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", + "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", "equality" ], - "time": "2017-01-29T09:50:25+00:00" + "time": "2018-02-01T13:46:46+00:00" }, { "name": "sebastian/diff", - "version": "1.4.3", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^6.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1084,32 +1345,32 @@ "keywords": [ "diff" ], - "time": "2017-05-22T07:24:03+00:00" + "time": "2017-08-03T08:09:46+00:00" }, { "name": "sebastian/environment", - "version": "2.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^5.0" + "phpunit/phpunit": "^6.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -1134,34 +1395,34 @@ "environment", "hhvm" ], - "time": "2016-11-26T07:53:53+00:00" + "time": "2017-07-01T08:51:00+00:00" }, { "name": "sebastian/exporter", - "version": "2.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~2.0" + "php": "^7.0", + "sebastian/recursion-context": "^3.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -1201,27 +1462,27 @@ "export", "exporter" ], - "time": "2016-11-19T08:54:04+00:00" + "time": "2017-04-03T13:19:02+00:00" }, { "name": "sebastian/global-state", - "version": "1.1.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.0" }, "suggest": { "ext-uopz": "*" @@ -1229,7 +1490,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1252,33 +1513,34 @@ "keywords": [ "global state" ], - "time": "2015-10-12T03:26:01+00:00" + "time": "2017-04-27T15:39:26+00:00" }, { "name": "sebastian/object-enumerator", - "version": "2.0.1", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", "shasum": "" }, "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~2.0" + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" }, "require-dev": { - "phpunit/phpunit": "~5" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -1298,32 +1560,77 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-02-18T15:18:39+00:00" + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" }, { "name": "sebastian/recursion-context", - "version": "2.0.0", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -1351,7 +1658,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-11-19T07:33:16+00:00" + "time": "2017-03-03T06:23:57+00:00" }, { "name": "sebastian/resource-operations", @@ -1439,40 +1746,37 @@ "time": "2016-10-03T07:35:21+00:00" }, { - "name": "symfony/yaml", - "version": "v3.3.5", + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "1f93a8d19b8241617f5074a123e282575b821df8" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/1f93a8d19b8241617f5074a123e282575b821df8", - "reference": "1f93a8d19b8241617f5074a123e282575b821df8", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", "shasum": "" }, "require": { - "php": ">=5.5.9" - }, - "require-dev": { - "symfony/console": "~2.8|~3.0" + "php": ">=5.3.3" }, "suggest": { - "symfony/console": "For validating YAML files using the lint command" + "ext-ctype": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "1.9-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Yaml\\": "" + "Symfony\\Polyfill\\Ctype\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1480,35 +1784,82 @@ "MIT" ], "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" } ], - "description": "Symfony Yaml Component", + "description": "Symfony polyfill for ctype functions", "homepage": "https://symfony.com", - "time": "2017-06-15T12:58:50+00:00" + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2017-04-07T12:08:54+00:00" }, { "name": "webmozart/assert", - "version": "1.2.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" }, "require-dev": { "phpunit/phpunit": "^4.6", @@ -1541,7 +1892,7 @@ "check", "validate" ], - "time": "2016-11-23T20:04:58+00:00" + "time": "2018-12-25T11:19:39+00:00" } ], "aliases": [], diff --git a/src/Client.php b/src/Client.php index ce7d4fb..5bbf030 100644 --- a/src/Client.php +++ b/src/Client.php @@ -91,7 +91,7 @@ public function connect($timeout = 5) private function sendFrameToOutput(Frame $frame) { - $this->output->emit('data', [(string) $frame]); + $this->output->emit('data', [$frame]); } public function send($destination, $body, array $headers = array()) diff --git a/tests/React/Tests/Stomp/ClientTest.php b/tests/React/Tests/Stomp/ClientTest.php index 2a51631..31f8a88 100644 --- a/tests/React/Tests/Stomp/ClientTest.php +++ b/tests/React/Tests/Stomp/ClientTest.php @@ -3,32 +3,37 @@ namespace React\Tests\Stomp; use React\Stomp\Client; -use React\Stomp\Io\InputStreamInterface; -use React\Stomp\Io\OutputStreamInterface; use React\Stomp\Protocol\Frame; +use React\EventLoop\LoopInterface; +use React\Stomp\Io\InputStreamInterface; +use React\Stream\ReadableResourceStream; +use React\Stream\WritableResourceStream; class ClientTest extends TestCase { /** @test */ public function connectShouldSendConnectFrame() { - $input = $this->createInputStreamMock(); - - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); - $output - ->expects($this->once()) - ->method('sendFrame') - ->with($this->frameIsEqual(new Frame('CONNECT', array('accept-version' => '1.1', 'host' => 'localhost')))); + $emitted = false; + $input = $this->createInputStream(); + $output = $this->createOutputStream(); + $output->on('data', function ($frame) use (&$emitted) { + $emitted = true; + $expected = new Frame('CONNECT', array('accept-version' => '1.1', 'host' => 'localhost')); + $this->assertEquals((string) $expected, (string) $frame); + }); $client = new Client($this->createLoopMock(), $input, $output, array('vhost' => 'localhost')); $client->connect(); + + $this->assertTrue($emitted); } /** @test */ public function connectShouldReturnPromise() { - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = new Client($this->createLoopMock(), $input, $output, array('vhost' => 'localhost')); $promise = $client->connect(); @@ -43,16 +48,16 @@ public function connectShouldReturnPromise() */ public function connectShouldRejectMissingHostOrVhost() { - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = new Client($this->createLoopMock(), $input, $output, array()); } /** @test */ public function connectTwiceShouldReturnTheSamePromise() { - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = new Client($this->createLoopMock(), $input, $output, array('vhost' => 'localhost')); $promise1 = $client->connect(); @@ -66,24 +71,21 @@ public function connectTwiceShouldReturnTheSamePromise() /** @test */ public function disconnectThenConnectShouldReturnNewPromise() { - $input = $this->createInputStreamMock(); - - $connectFrame = new Frame('CONNECT', array('accept-version' => '1.1', 'host' => 'localhost')); - - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); - $output - ->expects($this->at(0)) - ->method('sendFrame') - ->with($this->frameIsEqual($connectFrame)); - $output - ->expects($this->at(2)) - ->method('sendFrame') - ->with($this->frameIsEqual($connectFrame)); + $emitted = false; + $input = $this->createInputStream(); + $output = $this->createOutputStream(); + $output->on('connect', function ($frame) use (&$emitted) { + $emitted = true; + $expected = new Frame('CONNECT', array('accept-version' => '1.1', 'host' => 'localhost')); + $this->assertEquals((string) $expected, (string) $frame); + }); $client = new Client($this->createLoopMock(), $input, $output, array('vhost' => 'localhost')); $promise1 = $client->connect(); + $this->assertFalse($emitted); // Deferred $client->disconnect(); $promise2 = $client->connect(); + $this->assertFalse($emitted); // Deferred $this->assertInstanceOf('React\Promise\PromiseInterface', $promise1); $this->assertInstanceOf('React\Promise\PromiseInterface', $promise2); @@ -93,22 +95,22 @@ public function disconnectThenConnectShouldReturnNewPromise() /** @test */ public function itShouldEmitConnectAfterHandshake() { - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = new Client($this->createLoopMockWithConnectionTimer(), $input, $output, array('vhost' => 'localhost')); $client->on('connect', $this->expectCallableOnce()); $client->connect(); $frame = new Frame('CONNECTED', array('session' => '1234', 'server' => 'React/alpha')); - $input->emit('frame', array($frame)); + $input->emit('frame', [$frame]); } /** @test */ public function itShouldRejectPromiseIfConnectionFails() { - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = new Client($this->createLoopMock(), $input, $output, array('vhost' => 'localhost')); $client->connect() @@ -121,8 +123,8 @@ public function itShouldRejectPromiseIfConnectionFails() /** @test */ public function itShouldRejectPromiseIfConnectionTimeout() { - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $loop = $this->createLoopMock(); $timeout = 30; @@ -148,8 +150,8 @@ public function itShouldRejectPromiseIfConnectionTimeout() /** @test */ public function timeoutThenConnectShouldReturnANewPromise() { - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $loop = $this->createLoopMock(); $timeout = 30; @@ -178,8 +180,8 @@ public function timeoutThenConnectShouldReturnANewPromise() /** @test */ public function itShouldCancelTimerOnConnection() { - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $timeout = 30; $signature = uniqid('signature'); @@ -197,8 +199,8 @@ public function itShouldCancelTimerOnConnection() /** @test */ public function itShouldNotBeConnectedAfterConstructor() { - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = new Client($this->createLoopMock(), $input, $output, array('vhost' => 'localhost')); @@ -208,8 +210,8 @@ public function itShouldNotBeConnectedAfterConstructor() /** @test */ public function itShouldThrowAnExceptionOnConnectedFrameOutsideWindow() { - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $loop = $this->createLoopMock(); $errors = array(); @@ -228,8 +230,8 @@ public function itShouldThrowAnExceptionOnConnectedFrameOutsideWindow() /** @test */ public function itShouldBeConnectedWhenThePromiseIsResolved() { - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = new Client($this->createLoopMockWithConnectionTimer(), $input, $output, array('vhost' => 'localhost')); $client->connect(); @@ -243,8 +245,8 @@ public function itShouldBeConnectedWhenThePromiseIsResolved() /** @test */ public function itShouldNotBeConnectedAfterDisconnection() { - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = new Client($this->createLoopMockWithConnectionTimer(), $input, $output, array('vhost' => 'localhost')); $client->connect(); @@ -259,8 +261,8 @@ public function itShouldNotBeConnectedAfterDisconnection() /** @test */ public function itShouldResolveConnectPromiseAfterHandshake() { - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = new Client($this->createLoopMockWithConnectionTimer(), $input, $output, array('vhost' => 'localhost')); $client->on('connect', $this->expectCallableOnce()); @@ -275,8 +277,8 @@ public function itShouldResolveConnectPromiseAfterHandshake() /** @test */ public function itShouldChangeToConnectedStateWhenReceivingConnectedResponse() { - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = $this->getConnectedClient($input, $output); } @@ -284,18 +286,19 @@ public function itShouldChangeToConnectedStateWhenReceivingConnectedResponse() /** @test */ public function sendShouldSend() { - $input = $this->createInputStreamMock(); - - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); - $output - ->expects($this->at(1)) - ->method('sendFrame') - ->with($this->frameIsEqual( - new Frame('SEND', array('destination' => '/foo', 'content-length' => '5', 'content-type' => 'text/plain'), 'hello') - )); - + $emitted = false; + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = $this->getConnectedClient($input, $output); + $output->on('data', function ($frame) use (&$emitted) { + $emitted = true; + $expected = new Frame('SEND', array('destination' => '/foo', 'content-length' => '5', 'content-type' => 'text/plain'), 'hello'); + $this->assertEquals((string) $expected, (string) $frame); + }); + $client->send('/foo', 'hello'); + + $this->assertTrue($emitted); } /** @@ -304,20 +307,20 @@ public function sendShouldSend() */ public function subscribeWithAckMustIncludeAValidAckMethod($ack) { + $emitted = false; + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $callback = $this->createCallableMock(); - - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); - - $output - ->expects($this->at(1)) - ->method('sendFrame') - ->with($this->frameIsEqual( - new Frame('SUBSCRIBE', array('id' => 0, 'destination' => '/foo', 'ack' => $ack)) - )); - $client = $this->getConnectedClient($input, $output); + $output->on('data', function ($frame) use (&$emitted, $ack) { + $emitted = true; + $expected = new Frame('SUBSCRIBE', array('id' => 0, 'destination' => '/foo', 'ack' => $ack)); + $this->assertEquals((string) $expected, (string) $frame); + }); + $client->subscribeWithAck('/foo', $ack, $callback); + + $this->assertTrue($emitted); } public function provideAvailableAckMethods() @@ -331,43 +334,44 @@ public function provideAvailableAckMethods() /** @test */ public function subscribeHasUniqueIdHeader() { + $expectedId = 0; + $emitted = false; + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $callback = $this->createCallableMock(); - - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); - - $output - ->expects($this->at(1)) - ->method('sendFrame') - ->with($this->frameHasHeader('id', 0)); - - $output - ->expects($this->at(2)) - ->method('sendFrame') - ->with($this->frameHasHeader('id', 1)); - $client = $this->getConnectedClient($input, $output); + $output->on('data', function ($frame) use (&$emitted, &$expectedId) { + $emitted = true; + $this->assertEquals($expectedId, $frame->getHeader('id')); + }); + + $expectedId = 0; $client->subscribe('/foo', $callback); + $this->assertTrue($emitted); + + $expectedId = 1; + $emitted = false; $client->subscribe('/bar', $callback); + $this->assertTrue($emitted); } /** @test */ public function subscribeCanEmbedCustomHeader() { + $emitted = false; + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $callback = $this->createCallableMock(); - - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); - - $output - ->expects($this->at(1)) - ->method('sendFrame') - ->with($this->frameIsEqual( - new Frame('SUBSCRIBE', array('foo' => 'bar', 'id' => 0, 'destination' => '/foo', 'ack' => 'auto')) - )); - $client = $this->getConnectedClient($input, $output); + $output->on('data', function ($frame) use (&$emitted) { + $emitted = true; + $expected = new Frame('SUBSCRIBE', array('foo' => 'bar', 'id' => 0, 'destination' => '/foo', 'ack' => 'auto')); + $this->assertEquals((string) $expected, (string) $frame); + }); + $client->subscribe('/foo', $callback, array('foo' => 'bar')); + + $this->assertTrue($emitted); } /** @@ -378,8 +382,8 @@ public function subscribeWithAckDoesNotWorkWithAutoAckMode() { $callback = $this->createCallableMock(); - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = $this->getConnectedClient($input, $output); $client->subscribeWithAck('/foo', 'auto', $callback); @@ -401,8 +405,8 @@ public function subscribeWithAckCallbackShouldHaveAckResolverArgument($ack) $capturedResolver = $resolver; })); - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = $this->getConnectedClient($input, $output); $subscriptionId = $client->subscribeWithAck('/foo', $ack, $callback); @@ -438,15 +442,8 @@ public function acknowledgeWithAckResolverArgumentShouldSendAckFrame() $capturedResolver = $resolver; })); - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); - - $output - ->expects($this->at(2)) - ->method('sendFrame') - ->with($this->frameIsEqual( - new Frame('ACK', array('subscription' => 0, 'message-id' => 54321)) - )); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = $this->getConnectedClient($input, $output); $subscriptionId = $client->subscribeWithAck('/foo', 'client', $callback); @@ -458,7 +455,15 @@ public function acknowledgeWithAckResolverArgumentShouldSendAckFrame() ); $input->emit('frame', array($responseFrame)); + $emitted = false; + $output->on('data', function ($frame) use (&$emitted) { + $emitted = true; + $expected = new Frame('ACK', array('subscription' => 0, 'message-id' => 54321)); + $this->assertEquals((string) $expected, (string) $frame); + }); + $capturedResolver->ack(); + $this->assertTrue($emitted); } /** @test */ @@ -474,15 +479,8 @@ public function negativeAcknowledgeWithAckResolverArgumentShouldSendNackFrame() $capturedResolver = $resolver; })); - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); - - $output - ->expects($this->at(2)) - ->method('sendFrame') - ->with($this->frameIsEqual( - new Frame('NACK', array('subscription' => 0, 'message-id' => 54321)) - )); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = $this->getConnectedClient($input, $output); $subscriptionId = $client->subscribeWithAck('/foo', 'client', $callback); @@ -494,7 +492,15 @@ public function negativeAcknowledgeWithAckResolverArgumentShouldSendNackFrame() ); $input->emit('frame', array($responseFrame)); + $emitted = false; + $output->on('data', function ($frame) use (&$emitted) { + $emitted = true; + $expected = new Frame('NACK', array('subscription' => 0, 'message-id' => 54321)); + $this->assertEquals((string) $expected, (string) $frame); + }); + $capturedResolver->nack(); + $this->assertTrue($emitted); } /** @test */ @@ -510,8 +516,8 @@ public function messagesShouldGetRoutedToSubscriptions() $capturedFrame = $frame; })); - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = $this->getConnectedClient($input, $output); $subscriptionId = $client->subscribe('/foo', $callback); @@ -557,76 +563,76 @@ public function callbackShouldNotBeCalledAfterUnsubscribe($data) /** @test */ public function ackShouldSendAckFrame() { - $input = $this->createInputStreamMock(); - - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); - $output - ->expects($this->at(1)) - ->method('sendFrame') - ->with($this->frameIsEqual( - new Frame('ACK', array('subscription' => 12345, 'message-id' => 54321)) - )); - + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = $this->getConnectedClient($input, $output); + + $emitted = false; + $output->on('data', function ($frame) use (&$emitted) { + $emitted = true; + $expected = new Frame('ACK', array('subscription' => 12345, 'message-id' => 54321)); + $this->assertEquals((string) $expected, (string) $frame); + }); $client->ack(12345, 54321); + $this->assertTrue($emitted); } /** @test */ public function ackShouldSendAckFrameWithCustomHeaders() { - $input = $this->createInputStreamMock(); - - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); - $output - ->expects($this->at(1)) - ->method('sendFrame') - ->with($this->frameIsEqual( - new Frame('ACK', array('foo' => 'bar', 'subscription' => 12345, 'message-id' => 54321)) - )); - + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = $this->getConnectedClient($input, $output); + + $emitted = false; + $output->on('data', function ($frame) use (&$emitted) { + $emitted = true; + $expected = new Frame('ACK', array('foo' => 'bar', 'subscription' => 12345, 'message-id' => 54321)); + $this->assertEquals((string) $expected, (string) $frame); + }); $client->ack(12345, 54321, array('foo' => 'bar')); + $this->assertTrue($emitted); } /** @test */ public function nackShouldSendNackFrame() { - $input = $this->createInputStreamMock(); - - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); - $output - ->expects($this->at(1)) - ->method('sendFrame') - ->with($this->frameIsEqual( - new Frame('NACK', array('subscription' => 12345, 'message-id' => 54321)) - )); - + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = $this->getConnectedClient($input, $output); + + $emitted = false; + $output->on('data', function ($frame) use (&$emitted) { + $emitted = true; + $expected = new Frame('NACK', array('subscription' => 12345, 'message-id' => 54321)); + $this->assertEquals((string) $expected, (string) $frame); + }); $client->nack(12345, 54321); + $this->assertTrue($emitted); } /** @test */ public function nackShouldSendNackFrameWithCustomHeaders() { - $input = $this->createInputStreamMock(); - - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); - $output - ->expects($this->at(1)) - ->method('sendFrame') - ->with($this->frameIsEqual( - new Frame('NACK', array('foo' => 'bar', 'subscription' => 12345, 'message-id' => 54321)) - )); - + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = $this->getConnectedClient($input, $output); + + $emitted = false; + $output->on('data', function ($frame) use (&$emitted) { + $emitted = true; + $expected = new Frame('NACK', array('foo' => 'bar', 'subscription' => 12345, 'message-id' => 54321)); + $this->assertEquals((string) $expected, (string) $frame); + }); $client->nack(12345, 54321, array('foo' => 'bar')); + $this->assertTrue($emitted); } /** @test */ public function disconnectShouldGracefullyDisconnect() { - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = $this->getMockBuilder('React\Stomp\Client') ->setConstructorArgs(array($this->createLoopMock(), $input, $output, array('vhost' => 'localhost'))) @@ -639,18 +645,19 @@ public function disconnectShouldGracefullyDisconnect() $input->emit('frame', array(new Frame('CONNECTED'))); $client->disconnect(); - $output - ->expects($this->once()) - ->method('close'); - + $emitted = false; + $output->on('close', function () use (&$emitted) { + $emitted = true; + }); $input->emit('frame', array(new Frame('RECEIPT', array('receipt-id' => '1234')))); + $this->assertTrue($emitted); } /** @test */ public function processingErrorShouldResultInClientError() { - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = $this->getConnectedClient($input, $output); $client->on('error', $this->expectCallableOnce()); @@ -661,8 +668,8 @@ public function processingErrorShouldResultInClientError() /** @test */ public function inputErrorShouldResultInClientError() { - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = $this->getConnectedClient($input, $output); $client->on('error', $this->expectCallableOnce()); @@ -674,8 +681,8 @@ public function inputErrorShouldResultInClientError() /** @test */ public function inputCloseShouldResultInClientClose() { - $input = $this->createInputStreamMock(); - $output = $this->createMock('React\Stomp\Io\OutputStreamInterface'); + $input = $this->createInputStream(); + $output = $this->createOutputStream(); $client = $this->getConnectedClient($input, $output); $client->on('close', $this->expectCallableOnce()); @@ -683,7 +690,7 @@ public function inputCloseShouldResultInClientClose() $input->emit('close'); } - private function getConnectedClient(InputStreamInterface $input, OutputStreamInterface $output) + private function getConnectedClient(WritableResourceStream $input, ReadableResourceStream $output) { $client = new Client($this->createLoopMockWithConnectionTimer(), $input, $output, array('vhost' => 'localhost')); $client->connect(); @@ -695,7 +702,10 @@ private function getConnectedClient(InputStreamInterface $input, OutputStreamInt private function createInputStreamMock() { return $this->getMockBuilder('React\Stomp\Io\InputStream') - ->setConstructorArgs(array($this->createMock('React\Stomp\Protocol\Parser'))) + ->setConstructorArgs([ + fopen('php://temp', 'r+'), + $this->createMock('React\EventLoop\StreamSelectLoop') + ]) ->setMethods(array('isWritable', 'write', 'end', 'close')) ->getMock(); } @@ -709,9 +719,13 @@ private function createLoopMockWithConnectionTimer() { $loop = $this->createLoopMock(); - $timer = $this->createMock('React\EventLoop\Timer\TimerInterface'); - $timer->expects($this->once()) - ->method('cancel'); + $timer = $this->createMock('React\EventLoop\TimerInterface'); + + // $timer->expects($this->once()) + // ->method('cancel'); + $loop->expects($this->once()) + ->method('cancelTimer') + ->with($this->equalTo($timer)); $loop->expects($this->once()) ->method('addTimer') @@ -719,4 +733,14 @@ private function createLoopMockWithConnectionTimer() return $loop; } + + private function createInputStream() + { + return new WritableResourceStream(fopen('php://temp', 'w+'), $this->createLoopMock()); + } + + private function createOutputStream() + { + return new ReadableResourceStream(fopen('php://temp', 'r+'), $this->createLoopMock()); + } } diff --git a/tests/React/Tests/Stomp/Constraint/FrameHasHeader.php b/tests/React/Tests/Stomp/Constraint/FrameHasHeader.php index 4bd150c..c12f4c5 100644 --- a/tests/React/Tests/Stomp/Constraint/FrameHasHeader.php +++ b/tests/React/Tests/Stomp/Constraint/FrameHasHeader.php @@ -3,9 +3,9 @@ namespace React\Tests\Stomp\Constraint; use React\Stomp\Protocol\Frame; -use PHPUnit_Framework_Constraint as Constraint; +use PHPUnit\Framework\Constraint\Constraint as TestContraint; -class FrameHasHeader extends Constraint +class FrameHasHeader extends TestContraint { protected $name; protected $value; diff --git a/tests/React/Tests/Stomp/Constraint/FrameIsEqual.php b/tests/React/Tests/Stomp/Constraint/FrameIsEqual.php index c0af1e6..bc2dc58 100644 --- a/tests/React/Tests/Stomp/Constraint/FrameIsEqual.php +++ b/tests/React/Tests/Stomp/Constraint/FrameIsEqual.php @@ -3,9 +3,9 @@ namespace React\Tests\Stomp\Constraint; use React\Stomp\Protocol\Frame; -use PHPUnit_Framework_Constraint as Constraint; +use PHPUnit\Framework\Constraint\Constraint as TestContraint; -class FrameIsEqual extends Constraint +class FrameIsEqual extends TestContraint { protected $frame; diff --git a/tests/React/Tests/Stomp/Io/InputStreamTest.php b/tests/React/Tests/Stomp/Io/InputStreamTest.php deleted file mode 100644 index cdb5b71..0000000 --- a/tests/React/Tests/Stomp/Io/InputStreamTest.php +++ /dev/null @@ -1,107 +0,0 @@ -assertTrue($input->isWritable()); - } - - /** @test */ - public function incompleteWriteShouldNotEmitFrame() - { - $input = new InputStream(new Parser()); - $input->on('frame', $this->expectCallableNever()); - - $input->write("FOO\n\n"); - } - - /** @test */ - public function singleFrameWriteShouldEmitExactlyOneFrame() - { - $callback = $this->createCallableMock(); - $callback - ->expects($this->once()) - ->method('__invoke') - ->with($this->frameIsEqual(new Frame('CONNECTED'))); - - $input = new InputStream(new Parser()); - $input->on('frame', $callback); - - $input->write("CONNECTED\n\n\x00"); - } - - /** @test */ - public function manySegmentedFramesWrittenShouldEmitThoseFrames() - { - $callback = $this->createCallableMock(); - $callback - ->expects($this->at(0)) - ->method('__invoke') - ->with($this->frameIsEqual(new Frame('CONNECTED'))); - $callback - ->expects($this->at(1)) - ->method('__invoke') - ->with($this->frameIsEqual(new Frame('MESSAGE', array(), 'Body'))); - - $input = new InputStream(new Parser()); - $input->on('frame', $callback); - - $input->write("CONNECTED\n\n"); - $input->write("\x00"); - $input->write("MESSAGE\n\n"); - $input->write("Body\x00"); - $input->write("MESSAGE"); - } - - /** @test */ - public function endShouldWriteGivenDataThenClose() - { - $callback = $this->createCallableMock(); - $callback - ->expects($this->at(0)) - ->method('__invoke') - ->with($this->frameIsEqual(new Frame('CONNECTED'))); - - $input = new InputStream(new Parser()); - $input->on('frame', $callback); - $input->on('close', $this->expectCallableOnce()); - - $input->write("CONNECTED\n\n"); - $input->end("\x00"); - - $this->assertFalse($input->isWritable()); - } - - /** @test */ - public function closeShouldClose() - { - $input = new InputStream(new Parser()); - $input->on('frame', $this->expectCallableNever()); - $input->on('close', $this->expectCallableOnce()); - - $input->close(); - - $this->assertFalse($input->isWritable()); - } - - /** @test */ - public function writingAfterCloseShouldDoNothing() - { - $input = new InputStream(new Parser()); - $input->close(); - - $input->write('whoops'); - } -} diff --git a/tests/React/Tests/Stomp/Io/OutputStreamTest.php b/tests/React/Tests/Stomp/Io/OutputStreamTest.php deleted file mode 100644 index 153d32e..0000000 --- a/tests/React/Tests/Stomp/Io/OutputStreamTest.php +++ /dev/null @@ -1,71 +0,0 @@ -loop = $this->createMock('React\EventLoop\LoopInterface'); - $this->loop - ->expects($this->any()) - ->method('addTimer') - ->will($this->returnCallback(function ($seconds, $callback) { - call_user_func($callback); - })); - } - - /** @test */ - public function itShouldBeReadableByDefault() - { - $output = new OutputStream($this->loop); - - $this->assertTrue($output->isReadable()); - } - - /** @test */ - public function sendFrameShouldDumpAndEmitFrameData() - { - $frame = new Frame('CONNECT'); - - $callback = $this->createCallableMock(); - $callback - ->expects($this->once()) - ->method('__invoke') - ->with($this->frameIsEqual($frame)); - - $output = new OutputStream($this->loop); - $output->on('data', $callback); - $output->sendFrame($frame); - } - - /** @test */ - public function pausedStreamShouldQueueFrames() - { - $frame = new Frame('CONNECT'); - - $output = new OutputStream($this->loop); - $output->pause(); - - $output->on('data', $this->expectCallableNever()); - $output->sendFrame($frame); - $output->removeAllListeners(); - - $output->on('data', $this->expectCallableOnce()); - $output->resume(); - } - - /** @test */ - public function closeShouldMakeStreamUnreadable() - { - $output = new OutputStream($this->loop); - $output->close(); - - $this->assertFalse($output->isReadable()); - } -} From 83e59b39ee863aa1b3a68809dffbab14643f7cd4 Mon Sep 17 00:00:00 2001 From: Adrian Brown Date: Mon, 11 Feb 2019 23:03:20 +1100 Subject: [PATCH 04/14] Add frame buffer tests --- tests/React/Tests/Stomp/FrameBufferTest.php | 38 +++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tests/React/Tests/Stomp/FrameBufferTest.php diff --git a/tests/React/Tests/Stomp/FrameBufferTest.php b/tests/React/Tests/Stomp/FrameBufferTest.php new file mode 100644 index 0000000..0f0ba3b --- /dev/null +++ b/tests/React/Tests/Stomp/FrameBufferTest.php @@ -0,0 +1,38 @@ + '1.1', 'host' => 'localhost')); + $incompleteFrame = str_replace("\x00", '', $frame); + + $frameBuffer->addToBuffer($incompleteFrame); + + $this->assertEquals(0, count($frameBuffer->pullFrames())); + } + + /** @test */ + public function onlyCompleteFramesArePulled() + { + $frameBuffer = new FrameBuffer; + $frame = new Frame('CONNECT', array('accept-version' => '1.1', 'host' => 'localhost')); + $incompleteFrame = str_replace("\x00", '', $frame); + + $frameBuffer->addToBuffer((string) $frame); + $frameBuffer->addToBuffer($incompleteFrame); + + $this->assertEquals(1, count($frameBuffer->pullFrames())); + $this->assertEquals(0, count($frameBuffer->pullFrames())); + $frameBuffer->addToBuffer("\x00"); + $this->assertEquals(1, count($frameBuffer->pullFrames())); + $this->assertEquals(0, count($frameBuffer->pullFrames())); + } +} From 0ba7c8c65090749458e675e7b326623434326385 Mon Sep 17 00:00:00 2001 From: Adrian Brown Date: Mon, 11 Feb 2019 23:05:08 +1100 Subject: [PATCH 05/14] Make functional tests work with PHPUnit 6 --- tests/React/Functional/Stomp/FunctionalTestCase.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/React/Functional/Stomp/FunctionalTestCase.php b/tests/React/Functional/Stomp/FunctionalTestCase.php index ede90be..6287bb6 100644 --- a/tests/React/Functional/Stomp/FunctionalTestCase.php +++ b/tests/React/Functional/Stomp/FunctionalTestCase.php @@ -2,10 +2,11 @@ namespace React\Functional\Stomp; -use React\EventLoop\Factory as LoopFactory; use React\Stomp\Factory; +use React\EventLoop\Factory as LoopFactory; +use PHPUnit\Framework\TestCase as PHPUnitCase; -abstract class FunctionalTestCase extends \PHPUnit_Framework_TestCase +abstract class FunctionalTestCase extends PHPUnitCase { protected function getEventLoop() { From 1885dc2d7a87ef053024ec03db4295d22494347b Mon Sep 17 00:00:00 2001 From: Adrian Brown Date: Mon, 11 Feb 2019 23:14:19 +1100 Subject: [PATCH 06/14] Make PHP 5 compatible. --- src/Client.php | 6 +++--- src/Factory.php | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Client.php b/src/Client.php index 5bbf030..a281b2e 100644 --- a/src/Client.php +++ b/src/Client.php @@ -91,7 +91,7 @@ public function connect($timeout = 5) private function sendFrameToOutput(Frame $frame) { - $this->output->emit('data', [$frame]); + $this->output->emit('data', array($frame)); } public function send($destination, $body, array $headers = array()) @@ -167,7 +167,7 @@ public function resetConnectDeferred() public function handleFrameEvent(Frame $frame) { try { - $this->emit('frame', [$frame]); + $this->emit('frame', array($frame)); $this->processFrame($frame); } catch (ProcessingException $e) { $this->emit('error', array($e)); @@ -267,7 +267,7 @@ public function setConnectionStatus($status) { $this->connectionStatus = $status; - $this->emit('connection-status', [$this->connectionStatus]); + $this->emit('connection-status', array($this->connectionStatus)); } public function generateReceiptId() diff --git a/src/Factory.php b/src/Factory.php index 8994d2f..6394099 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -34,8 +34,8 @@ public function createClient(array $options = array(), bool $silent = false) $connection = $this->createConnection($options); $frameBuffer = new FrameBuffer; - $input = new WritableResourceStream(STDOUT, $this->loop); - $output = new ReadableResourceStream(STDIN, $this->loop); + $input = new WritableResourceStream(fopen('php://stdout', 'w'), $this->loop); + $output = new ReadableResourceStream(fopen('php://stdin', 'r'), $this->loop); $output->pipe($connection); if ($silent === false) { @@ -46,12 +46,12 @@ public function createClient(array $options = array(), bool $silent = false) $frames = $frameBuffer->addToBuffer($data)->pullFrames(); foreach ($frames as $frame) { - $input->emit('frame', [$frame]); + $input->emit('frame', array($frame)); } })); $connection->on('error', function ($error) use ($input) { - $input->emit('error', [$error]); + $input->emit('error', array($error)); }); $connection->on('close', function () use ($input) { From 74d0fd4e1068f0f3fe980eba79318a756173cefc Mon Sep 17 00:00:00 2001 From: Adrian Brown Date: Mon, 11 Feb 2019 23:43:32 +1100 Subject: [PATCH 07/14] Fix composer lock's phpunit versions for travis. --- composer.lock | 439 ++++++++++++++++++-------------------------------- 1 file changed, 154 insertions(+), 285 deletions(-) diff --git a/composer.lock b/composer.lock index 7b6155b..c7b7d59 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8ae7442e52f825d921a077245c79a218", + "content-hash": "438da32be308281cdb4db102bf60fc4a", "packages": [ { "name": "evenement/evenement", @@ -477,108 +477,6 @@ ], "time": "2018-06-11T23:09:50+00:00" }, - { - "name": "phar-io/manifest", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "phar-io/version": "^1.0.1", - "php": "^5.6 || ^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-03-05T18:14:27+00:00" - }, - { - "name": "phar-io/version", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "time": "2017-03-05T17:38:23+00:00" - }, { "name": "phpdocumentor/reflection-common", "version": "1.0.1", @@ -796,40 +694,40 @@ }, { "name": "phpunit/php-code-coverage", - "version": "5.3.2", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac" + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.0", - "phpunit/php-file-iterator": "^1.4.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^2.0.1", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.0", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1" + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" }, "suggest": { - "ext-xdebug": "^2.5.5" + "ext-xdebug": "^2.5.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.3.x-dev" + "dev-master": "4.0.x-dev" } }, "autoload": { @@ -844,7 +742,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", + "email": "sb@sebastian-bergmann.de", "role": "lead" } ], @@ -855,7 +753,7 @@ "testing", "xunit" ], - "time": "2018-04-06T15:36:58+00:00" + "time": "2017-04-02T07:44:40+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1045,16 +943,16 @@ }, { "name": "phpunit/phpunit", - "version": "6.5.14", + "version": "5.7.23", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7" + "reference": "78532d5269d984660080d8e0f4c99c5c2ea65ffe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bac23fe7ff13dbdb461481f706f0e9fe746334b7", - "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/78532d5269d984660080d8e0f4c99c5c2ea65ffe", + "reference": "78532d5269d984660080d8e0f4c99c5c2ea65ffe", "shasum": "" }, "require": { @@ -1063,35 +961,33 @@ "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "^1.6.1", - "phar-io/manifest": "^1.0.1", - "phar-io/version": "^1.0", - "php": "^7.0", - "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^5.3", - "phpunit/php-file-iterator": "^1.4.3", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^1.0.9", - "phpunit/phpunit-mock-objects": "^5.0.9", - "sebastian/comparator": "^2.1", - "sebastian/diff": "^2.0", - "sebastian/environment": "^3.1", - "sebastian/exporter": "^3.1", - "sebastian/global-state": "^2.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^1.0", - "sebastian/version": "^2.0.1" + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.4.3", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "~1.0.3|~2.0", + "symfony/yaml": "~2.1|~3.0" }, "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2", - "phpunit/dbunit": "<3.0" + "phpdocumentor/reflection-docblock": "3.0.2" }, "require-dev": { "ext-pdo": "*" }, "suggest": { "ext-xdebug": "*", - "phpunit/php-invoker": "^1.1" + "phpunit/php-invoker": "~1.1" }, "bin": [ "phpunit" @@ -1099,7 +995,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.5.x-dev" + "dev-master": "5.7.x-dev" } }, "autoload": { @@ -1125,33 +1021,33 @@ "testing", "xunit" ], - "time": "2019-02-01T05:22:47+00:00" + "time": "2017-10-15T06:13:55+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "5.0.10", + "version": "3.4.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", - "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.5", - "php": "^7.0", - "phpunit/php-text-template": "^1.2.1", - "sebastian/exporter": "^3.1" + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" }, "conflict": { - "phpunit/phpunit": "<6.0" + "phpunit/phpunit": "<5.4.0" }, "require-dev": { - "phpunit/phpunit": "^6.5.11" + "phpunit/phpunit": "^5.4" }, "suggest": { "ext-soap": "*" @@ -1159,7 +1055,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0.x-dev" + "dev-master": "3.2.x-dev" } }, "autoload": { @@ -1174,7 +1070,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", + "email": "sb@sebastian-bergmann.de", "role": "lead" } ], @@ -1184,7 +1080,7 @@ "mock", "xunit" ], - "time": "2018-08-09T05:50:03+00:00" + "time": "2017-06-30T09:13:00+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1233,30 +1129,30 @@ }, { "name": "sebastian/comparator", - "version": "2.1.3", + "version": "1.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/diff": "^2.0 || ^3.0", - "sebastian/exporter": "^3.1" + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.0" }, "require-dev": { - "phpunit/phpunit": "^6.4" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -1287,38 +1183,38 @@ } ], "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", + "homepage": "http://www.github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", "equality" ], - "time": "2018-02-01T13:46:46+00:00" + "time": "2017-01-29T09:50:25+00:00" }, { "name": "sebastian/diff", - "version": "2.0.1", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^6.2" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -1345,32 +1241,32 @@ "keywords": [ "diff" ], - "time": "2017-08-03T08:09:46+00:00" + "time": "2017-05-22T07:24:03+00:00" }, { "name": "sebastian/environment", - "version": "3.1.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^6.1" + "phpunit/phpunit": "^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1395,34 +1291,34 @@ "environment", "hhvm" ], - "time": "2017-07-01T08:51:00+00:00" + "time": "2016-11-26T07:53:53+00:00" }, { "name": "sebastian/exporter", - "version": "3.1.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/recursion-context": "^3.0" + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1462,27 +1358,27 @@ "export", "exporter" ], - "time": "2017-04-03T13:19:02+00:00" + "time": "2016-11-19T08:54:04+00:00" }, { "name": "sebastian/global-state", - "version": "2.0.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "~4.2" }, "suggest": { "ext-uopz": "*" @@ -1490,7 +1386,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -1513,34 +1409,33 @@ "keywords": [ "global state" ], - "time": "2017-04-27T15:39:26+00:00" + "time": "2015-10-12T03:26:01+00:00" }, { "name": "sebastian/object-enumerator", - "version": "3.0.3", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "~5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1560,77 +1455,32 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-08-03T12:35:26+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "773f97c67f28de00d397be301821b06708fca0be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", - "reference": "773f97c67f28de00d397be301821b06708fca0be", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2017-03-29T09:07:27+00:00" + "time": "2017-02-18T15:18:39+00:00" }, { "name": "sebastian/recursion-context", - "version": "3.0.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1658,7 +1508,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03T06:23:57+00:00" + "time": "2016-11-19T07:33:16+00:00" }, { "name": "sebastian/resource-operations", @@ -1804,44 +1654,63 @@ "time": "2018-08-06T14:22:27+00:00" }, { - "name": "theseer/tokenizer", - "version": "1.1.0", + "name": "symfony/yaml", + "version": "v3.4.22", "source": { "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + "url": "https://github.com/symfony/yaml.git", + "reference": "ba11776e9e6c15ad5759a07bffb15899bac75c2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "url": "https://api.github.com/repos/symfony/yaml/zipball/ba11776e9e6c15ad5759a07bffb15899bac75c2d", + "reference": "ba11776e9e6c15ad5759a07bffb15899bac75c2d", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.0" + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2017-04-07T12:08:54+00:00" + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T10:59:17+00:00" }, { "name": "webmozart/assert", From 8999bf864ed92586178f16b80827e1bb0f1a07a5 Mon Sep 17 00:00:00 2001 From: Adrian Brown Date: Mon, 11 Feb 2019 23:49:55 +1100 Subject: [PATCH 08/14] Downgrade dependencies again where minimum requirement was php 7 --- composer.lock | 86 ++++++++++++++++++++++----------------------------- 1 file changed, 37 insertions(+), 49 deletions(-) diff --git a/composer.lock b/composer.lock index c7b7d59..34c5509 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "438da32be308281cdb4db102bf60fc4a", + "content-hash": "f45a878cedbacf3be6ea97a8c0a636e5", "packages": [ { "name": "evenement/evenement", @@ -377,32 +377,32 @@ "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.1.0", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">=5.3,<8.0-DEV" }, "require-dev": { "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "^6.2.3", - "squizlabs/php_codesniffer": "^3.0.2" + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -427,47 +427,41 @@ "constructor", "instantiate" ], - "time": "2017-07-22T11:58:36+00:00" + "time": "2015-06-14T21:17:01+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.8.1", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" + "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8e6e04167378abf1ddb4d3522d8755c5fd90d102", + "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102", "shasum": "" }, "require": { - "php": "^7.1" - }, - "replace": { - "myclabs/deep-copy": "self.version" + "php": ">=5.4.0" }, "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" + "doctrine/collections": "1.*", + "phpunit/phpunit": "~4.1" }, "type": "library", "autoload": { "psr-4": { "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "Create deep copies (clones) of your objects", + "homepage": "https://github.com/myclabs/DeepCopy", "keywords": [ "clone", "copy", @@ -475,7 +469,7 @@ "object", "object graph" ], - "time": "2018-06-11T23:09:50+00:00" + "time": "2017-04-12T18:52:22+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -533,35 +527,29 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + "reference": "46f7e8bb075036c92695b15a1ddb6971c751e585" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/46f7e8bb075036c92695b15a1ddb6971c751e585", + "reference": "46f7e8bb075036c92695b15a1ddb6971c751e585", "shasum": "" }, "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0", + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { - "doctrine/instantiator": "~1.0.5", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.4" + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.x-dev" - } - }, "autoload": { "psr-4": { "phpDocumentor\\Reflection\\": [ @@ -580,7 +568,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-11-30T07:14:17+00:00" + "time": "2017-07-15T11:38:20+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -894,29 +882,29 @@ }, { "name": "phpunit/php-token-stream", - "version": "2.0.2", + "version": "1.4.11", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "791198a2c6254db10131eecfe8c06670700904db" + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", - "reference": "791198a2c6254db10131eecfe8c06670700904db", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": "^7.0" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^6.2.4" + "phpunit/phpunit": "~4.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -939,7 +927,7 @@ "keywords": [ "tokenizer" ], - "time": "2017-11-27T05:48:46+00:00" + "time": "2017-02-27T10:12:30+00:00" }, { "name": "phpunit/phpunit", From c65a0eae9b85cf9880751ed357c95e77f2c34cea Mon Sep 17 00:00:00 2001 From: Adrian Brown Date: Mon, 11 Feb 2019 23:59:18 +1100 Subject: [PATCH 09/14] Try to fix PHP 5.6 failure. --- tests/React/Tests/Stomp/FactoryTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/React/Tests/Stomp/FactoryTest.php b/tests/React/Tests/Stomp/FactoryTest.php index d26b56c..9a8e29e 100644 --- a/tests/React/Tests/Stomp/FactoryTest.php +++ b/tests/React/Tests/Stomp/FactoryTest.php @@ -38,7 +38,7 @@ public function testCreateClient() $loop = $this->createMock('React\EventLoop\LoopInterface'); $factory = new Factory($loop); - $client = $factory->createClient(array('host' => 'localhost', 'port' => 37235)); + $client = $factory->createClient(array('host' => 'localhost', 'port' => 37235), true); $this->assertInstanceOf('React\Stomp\Client', $client); } From 4b2851aacb3265ed7885ad34ceb700d65e01e6de Mon Sep 17 00:00:00 2001 From: Adrian Brown Date: Tue, 12 Feb 2019 00:01:40 +1100 Subject: [PATCH 10/14] Try to fix PHP 5.6 failure. --- tests/React/Functional/Stomp/FunctionalTestCase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/React/Functional/Stomp/FunctionalTestCase.php b/tests/React/Functional/Stomp/FunctionalTestCase.php index 6287bb6..a1162ec 100644 --- a/tests/React/Functional/Stomp/FunctionalTestCase.php +++ b/tests/React/Functional/Stomp/FunctionalTestCase.php @@ -31,6 +31,6 @@ protected function getClient($loop, array $options = array()) $default = require $configFile; $options = array_merge($default, $options); - return $factory->createClient($options); + return $factory->createClient($options, true); } } From 806171c5b22b8976014d1548ebc4fdddee8b5560 Mon Sep 17 00:00:00 2001 From: Adrian Brown Date: Tue, 12 Feb 2019 00:14:21 +1100 Subject: [PATCH 11/14] Remove bool typehint. --- src/Factory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Factory.php b/src/Factory.php index 6394099..e08cbc7 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -27,7 +27,7 @@ public function __construct(LoopInterface $loop) $this->loop = $loop; } - public function createClient(array $options = array(), bool $silent = false) + public function createClient(array $options = array(), $silent = false) { $options = array_merge($this->defaultOptions, $options); @@ -38,7 +38,7 @@ public function createClient(array $options = array(), bool $silent = false) $output = new ReadableResourceStream(fopen('php://stdin', 'r'), $this->loop); $output->pipe($connection); - if ($silent === false) { + if (! $silent) { $connection->pipe($input); } From 8764df332b734e1e09b4abb1366e6813bad22e31 Mon Sep 17 00:00:00 2001 From: Adrian Brown Date: Tue, 12 Feb 2019 00:31:54 +1100 Subject: [PATCH 12/14] Apply same travis build fix from #49. --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 130250b..0a88ea2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,8 @@ before_script: sudo service rabbitmq-server start; fi - if [ "$STOMP_PROVIDER" = 'activemq' ]; then - sudo apt install activemq tree; + sudo apt update; + sudo apt install activemq; sudo cp tests/utils/activemq.xml /etc/activemq/instances-available/main/; sudo ln -s /etc/activemq/instances-available/main /etc/activemq/instances-enabled/main; sudo service activemq start; From f7576e8ad93b4cc3e0434076121c2a5613f5dfab Mon Sep 17 00:00:00 2001 From: Adrian Brown Date: Tue, 12 Feb 2019 07:46:23 +1100 Subject: [PATCH 13/14] Revert functional tests to ensure the new second parameter for createClient is non-breaking. --- tests/React/Functional/Stomp/FunctionalTestCase.php | 2 +- tests/React/Tests/Stomp/FactoryTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/React/Functional/Stomp/FunctionalTestCase.php b/tests/React/Functional/Stomp/FunctionalTestCase.php index a1162ec..6287bb6 100644 --- a/tests/React/Functional/Stomp/FunctionalTestCase.php +++ b/tests/React/Functional/Stomp/FunctionalTestCase.php @@ -31,6 +31,6 @@ protected function getClient($loop, array $options = array()) $default = require $configFile; $options = array_merge($default, $options); - return $factory->createClient($options, true); + return $factory->createClient($options); } } diff --git a/tests/React/Tests/Stomp/FactoryTest.php b/tests/React/Tests/Stomp/FactoryTest.php index 9a8e29e..d26b56c 100644 --- a/tests/React/Tests/Stomp/FactoryTest.php +++ b/tests/React/Tests/Stomp/FactoryTest.php @@ -38,7 +38,7 @@ public function testCreateClient() $loop = $this->createMock('React\EventLoop\LoopInterface'); $factory = new Factory($loop); - $client = $factory->createClient(array('host' => 'localhost', 'port' => 37235), true); + $client = $factory->createClient(array('host' => 'localhost', 'port' => 37235)); $this->assertInstanceOf('React\Stomp\Client', $client); } From 5713405fa7d537dfb67ddfce6f6fc03976977454 Mon Sep 17 00:00:00 2001 From: Adrian Brown Date: Tue, 12 Feb 2019 09:45:07 +1100 Subject: [PATCH 14/14] Always set status via setConnectionStatus for the connection-status event. --- src/Client.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Client.php b/src/Client.php index a281b2e..717b7ed 100644 --- a/src/Client.php +++ b/src/Client.php @@ -155,7 +155,7 @@ public function disconnect() $this->connectDeferred = null; $this->connectPromise = null; - $this->connectionStatus = 'not-connected'; + $this->setConnectionStatus('not-connected'); } public function resetConnectDeferred() @@ -176,7 +176,7 @@ public function handleFrameEvent(Frame $frame) $this->connectDeferred->reject($e); $this->connectDeferred = null; $this->connectPromise = null; - $this->connectionStatus = 'not-connected'; + $this->setConnectionStatus('not-connected'); } } } @@ -190,7 +190,7 @@ public function handleCloseEvent() { $this->connectDeferred = null; $this->connectPromise = null; - $this->connectionStatus = 'not-connected'; + $this->setConnectionStatus('not-connected'); $this->emit('close'); }