From b5677b47bc4b6f1053dea357a1744d7ae6701e46 Mon Sep 17 00:00:00 2001 From: Brent Scheffler Date: Fri, 18 Oct 2019 10:58:34 -0700 Subject: [PATCH] - Removing PubSub namespace. - Removing Dispatcher::listen() method. - Adding DispatchException class to be thrown if Message cannot be dispatched. - Queue::listen() now calls \pcntl_signal_dispatch() after passing message (if any) to callback. - Adding Queue::shutdown() message that will exit infinite loop in listen(). - Setting some default values in Beanstalk instead of falling back to null. - Removing release script and everything associated with. Releases now handled through Github. --- .editorconfig | 8 + Makefile | 7 +- README.md | 170 ++--- VERSION | 1 - composer.json | 38 +- composer.lock | 1206 +++++++++++++++++---------------- release | 45 -- src/DispatchException.php | 37 + src/Dispatcher.php | 79 +-- src/Message.php | 4 +- src/MessageTransformer.php | 1 - src/PubSub/PubSubAbstract.php | 45 -- src/PubSub/Redis.php | 87 --- src/PubSub/Sns.php | 46 -- src/Queue/Beanstalk.php | 49 +- src/Queue/Google.php | 6 +- src/Queue/Queue.php | 23 +- src/Queue/Redis.php | 13 +- src/Queue/RedisPubSub.php | 7 +- src/Queue/Sqs.php | 4 +- src/Router.php | 2 +- tests/DispatcherTest.php | 6 +- 22 files changed, 891 insertions(+), 993 deletions(-) create mode 100644 .editorconfig delete mode 100644 VERSION delete mode 100755 release create mode 100644 src/DispatchException.php delete mode 100644 src/PubSub/PubSubAbstract.php delete mode 100644 src/PubSub/Redis.php delete mode 100644 src/PubSub/Sns.php diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..ce78596 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +root=true + +[*] +end_of_line=lf +indent_style=tab +indent_size=4 +charset=utf-8 +trim_trailing_whitespace=true \ No newline at end of file diff --git a/Makefile b/Makefile index 13e3ff9..d1eea77 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,3 @@ -.PHONY: release - test: vendor/bin/phpunit @@ -7,7 +5,4 @@ coverage: vendor/bin/phpunit --coverage-clover=build/logs/clover.xml analyze: - vendor/bin/psalm - -release: - php release \ No newline at end of file + vendor/bin/psalm \ No newline at end of file diff --git a/README.md b/README.md index 0ded271..6e7ab89 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,18 @@ # Syndicate -See the syndicate-framework repo for framework documentation. +## Install -## Using without a Router and Dispatcher +```bash +composer require nimbly/syndicate +``` + +## Basic usage ### Create Queue instance + ```php $queue = new Syndicate\Queue\Sqs( - getenv("SQS_QUEUE_URL"), + "https://queue.url", new SqsClient([ 'version' => 'latest', 'region' => 'us-west-2' @@ -15,11 +20,32 @@ $queue = new Syndicate\Queue\Sqs( ); ``` -### Set a serializer and deserializer callback (optional) +### Listen on queue -The serializer callback is applied to each outgoing queue message payload. It defaults to ```\json_encode```. +Listening is a **blocking** call and runs in an infinite loop. Your callback will be triggered when a new Message has arrived. -You can pass in any ```\callable``` instance as the serializer. +```php +$queue->listen(function(Message $message): void { + + /** + * + * Process the message... + * + */ + + // Delete the message from Queue. + $message->delete(); + +}); +``` + +### Setting a custom serializer and deserializer + +By default, Syndicate assumes your messages are JSON and will attempt to auto serialize/deserialize accordingly. + +However, if your messages are in some other format, you may supply your own serializer and deserializer callbacks. + +The serializer is applied to all outgoing message payloads. ```php $queue->setSerializer(function($message){ @@ -29,20 +55,16 @@ $queue->setSerializer(function($message){ }); ``` -The deserializer callback is applied to each incoming queue message payload. It defaults to ```\json_decode```. +The deserializer callback is applied to all incoming message payloads. -You can pass in any ```\callable``` instance as the deserializer. This is useful for performing more advanced -message deserialization. - -For example, to handle deserializing a message payload from SQS that was forwarded by SNS, you could pass in -the following. +For example, to handle deserializing a message payload from SQS that was forwarded by SNS, you could pass in the following deserializer callback. ```php -$queue->setDeserializer(function($payload){ +$queue->setDeserializer(function($payload) { $payload = \json_decode($payload); - if( property_exists($payload, "Type") && + if( \property_exists($payload, "Type") && $payload->Type === "Notification" ){ return \json_decode($payload->Message); } @@ -52,53 +74,86 @@ $queue->setDeserializer(function($payload){ }); ``` -### Listen on queue +### Shutting down the Queue -Listening is a blocking call and your callback will be triggered when a new Message has arrived. +You may shutdown the queue by using the ```shutdown()``` method. + +The Queue instance will respond to PCNTL signals in a safe manner that will not interrupt in the middle of Message processing. +You can install signal handlers in your code to cleanly and safely shutdown the service. ```php -$queue->listen(function(Message $message){ +\pcntl_signal( + SIGINT, + function() use ($queue): void { - echo "Message received!\n"; - $message->delete(); + echo "Got SIGINT. Shutting queue down."; + $queue->shutdown(); -}); + } +); ``` -## Using a Router and Dispatcher +## Routing and Dispatching -Using a Router and Dispatcher you can have your messages passed off to specific Handlers. How you route is up to you and the message format. +Using the `Dispatcher` and `Router` you can have your messages passed off to specific Handlers. How you route is up to you and the message format. Commonly, a message will contain a message type or event name - these are prime candidates for keys to routing. ### Router -Create a new ```Router``` by passing in the ```\callable``` route resolver and an ```array``` of key and value pairs as the route definitions. + +Create a new `Router` instance by passing in a `\callable` route resolver and an `array` of key and value pairs as route definitions. + +### Route resolver + +The route resolver is responsible for taking the incoming Message instance and finding a matching route to dispatch the Message to. + +The dispatcher will loop through all configured routes and call the resolver with the Message and a route. + +The resolver must simple return a `bool` value indicating whether the message matches the given route. + + +### Route definitions + +The route definitions are an array of key/value pairs mapping any key you want to either a `callable`, `string` in the format of `Full\Namespace\ClassName@methodName`, or an array of the above. + ```php -$router = new Router(function(Message $message, string $route){ +$router = new Router(function(Message $message, string $routeKey): bool { - return $message->getPayload()->eventName == $route; + return $message->getPayload()->eventName == $routeKey; }, [ - 'UserRegistered' => ["\App\Handlers\UserHandler", "userRegistered"], - 'UserClosedAccount' => ["\App\Handlers\UserHandler", "userAccountClosed"] + 'UserLoggedOff' => function(Message $message): void { + // Do some session cleanup stuff... + }, + + 'UserRegistered' => '\App\Handlers\UserHandler@userRegistered', + + 'UserClosedAccount' => [ + '\App\Handlers\UserHandler@userAccountClosed', + '\App\Handlers\NotificationHandler@userAccountClosed' + ] ]); ``` ### Dispatcher -Create a new ```Dispatcher``` by passing the ```Router``` instance. + +Create a new ```Dispatcher``` instance by passing the ```Router``` instance. ```php $dispatcher = new Dispatcher($router); ``` ### Add a default handler -If the ```Router``` cannot resolve a route for the ```Message```, the ```Dispatcher``` will attempt to pass the message off to the default handler. + +If the ```Router``` cannot resolve a route for the ```Message```, the ```Dispatcher``` will attempt to pass the message off to its default handler. + +The default handler can be set as a ```callable``` and accepts the ```Message``` instance. ```php -$dispatcher->setDefaultHandler(function(Message $message){ +$dispatcher->setDefaultHandler(function(Message $message): void { Log::critical("No route defined for {$message->getPayload()->eventName}!"); $message->release(); @@ -106,59 +161,14 @@ $dispatcher->setDefaultHandler(function(Message $message){ }); ``` -### Starting the listener -```php -$dispatcher->listen($queue); -``` - -## Putting it all together -```php -// Create Queue instance -$queue = new Syndicate\Queue\Sqs( - getenv("SQS_QUEUE_URL"), - new SqsClient([ - 'version' => 'latest', - 'region' => 'us-west-2' - ]) -); - -// Set a custom deserializer. -$queue->setDeserializer(function($payload){ - - $payload = \json_decode($payload); - - if( property_exists($payload, "Type") && - $payload->Type === "Notification" ){ - return \json_decode($payload->Message); - } - - return $payload; - -}); - -// Create Router instance with a resolver and our list of routes. -$router = new Router(function(Message $message, string $route){ - - return $message->getPayload()->eventName == $route; - -}, [ +If the Message cannot be dispatched and no default handler was given, a `DispatchException` will be thrown. - 'UserRegistered' => ["\App\Handlers\UserHandler", "userRegistered"], - 'UserClosedAccount' => ["\App\Handlers\UserHandler", "userAccountClosed"] +### Using the Dispatcher with the Queue -]); - -// Create Dispatcher instance. -$dispatcher = new Dispatcher($router); - -// Set a default handler. -$dispatcher->setDefaultHandler(function(Message $message){ +```php +$queue->listen(function(Message $message) use ($dispatcher): void { - Log::critical("No route defined for {$message->getPayload()->eventName}!"); - $message->release(); + $dispatcher->dispatch($message); }); - -// Listen for new messages. -$dispatcher->listen(); ``` \ No newline at end of file diff --git a/VERSION b/VERSION deleted file mode 100644 index 5d4294b..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.5.1 \ No newline at end of file diff --git a/composer.json b/composer.json index adcdc81..066b172 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,6 @@ { - "name": "nimbly\/syndicate", - "description": "Framework agnostic queue and pubsub library.", - "version": "0.5.1", + "name": "nimbly/syndicate", + "description": "Simple queue consumer framework that supports message dispatching.", "type": "library", "license": "MIT", "authors": [ @@ -11,29 +10,30 @@ } ], "suggest": { - "pda\/pheanstalk": "To add support for Beanstalkd queue.", - "predis\/predis": "To add support for Redis based queue and pub\/sub functionality.", - "aws\/aws-sdk-php": "To add support for AWS Simple Queue Service (SQS).", - "google\/cloud-pubsub": "To add support for Google Cloud Pubsub." + "pda/pheanstalk": "To add support for Beanstalkd queue.", + "predis/predis": "To add support for Redis based queue and pub/sub functionality.", + "aws/aws-sdk-php": "To add support for AWS Simple Queue Service (SQS).", + "google/cloud-pubsub": "To add support for Google Cloud Pubsub." }, "require": { - "php": ">=7.0" + "php": ">=7.2", + "ext-json": "*" }, "require-dev": { - "vimeo\/psalm": "^3.1", - "phpunit\/phpunit": "^8.0", - "pda\/pheanstalk": "~3.0", - "aws\/aws-sdk-php": "~3.0", - "predis\/predis": "~1.0", - "google\/cloud-pubsub": "^1.7", - "symfony\/var-dumper": "^4.2", - "php-coveralls\/php-coveralls": "^2.1", - "squizlabs\/php_codesniffer": "^3.4", - "phploc\/phploc": "^5.0" + "vimeo/psalm": "^3.1", + "phpunit/phpunit": "^8.0", + "pda/pheanstalk": "~3.0", + "aws/aws-sdk-php": "~3.0", + "predis/predis": "~1.0", + "google/cloud-pubsub": "^1.7", + "symfony/var-dumper": "^4.2", + "php-coveralls/php-coveralls": "^2.1", + "squizlabs/php_codesniffer": "^3.4", + "phploc/phploc": "^5.0" }, "autoload": { "psr-4": { - "Syndicate\\": "src\/" + "Syndicate\\": "src/" } } } \ No newline at end of file diff --git a/composer.lock b/composer.lock index 2808f9d..9c62137 100644 --- a/composer.lock +++ b/composer.lock @@ -4,31 +4,32 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "030f345ab804b9a54f2d2eda1b5cf4d4", + "content-hash": "6c87dbf12b47a18df2b471bc70bbf4fe", "packages": [], "packages-dev": [ { "name": "amphp/amp", - "version": "v2.1.1", + "version": "v2.3.1", "source": { "type": "git", "url": "https://github.com/amphp/amp.git", - "reference": "7075ef7d74dbd32626bfd31c976b23055c3ade6a" + "reference": "5a294f13810844e3bdda28c0f352821d735ca9b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/7075ef7d74dbd32626bfd31c976b23055c3ade6a", - "reference": "7075ef7d74dbd32626bfd31c976b23055c3ade6a", + "url": "https://api.github.com/repos/amphp/amp/zipball/5a294f13810844e3bdda28c0f352821d735ca9b3", + "reference": "5a294f13810844e3bdda28c0f352821d735ca9b3", "shasum": "" }, "require": { "php": ">=7" }, "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", "amphp/phpunit-util": "^1", - "friendsofphp/php-cs-fixer": "^2.3", + "ext-json": "*", "phpstan/phpstan": "^0.8.5", - "phpunit/phpunit": "^6.0.9", + "phpunit/phpunit": "^6.0.9 | ^7", "react/promise": "^2" }, "type": "library", @@ -51,14 +52,6 @@ "MIT" ], "authors": [ - { - "name": "Bob Weinand", - "email": "bobwei9@hotmail.com" - }, - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - }, { "name": "Daniel Lowrey", "email": "rdlowrey@php.net" @@ -66,6 +59,14 @@ { "name": "Aaron Piotrowski", "email": "aaron@trowski.com" + }, + { + "name": "Bob Weinand", + "email": "bobwei9@hotmail.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" } ], "description": "A non-blocking concurrency framework for PHP applications.", @@ -81,20 +82,20 @@ "non-blocking", "promise" ], - "time": "2018-12-11T10:31:37+00:00" + "time": "2019-10-01T19:39:23+00:00" }, { "name": "amphp/byte-stream", - "version": "v1.5.1", + "version": "v1.7.0", "source": { "type": "git", "url": "https://github.com/amphp/byte-stream.git", - "reference": "6bbfcb6f47e92577e739586ba0c87e867be70a23" + "reference": "3d457738751295b9bf6b15036578e7823919f724" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/byte-stream/zipball/6bbfcb6f47e92577e739586ba0c87e867be70a23", - "reference": "6bbfcb6f47e92577e739586ba0c87e867be70a23", + "url": "https://api.github.com/repos/amphp/byte-stream/zipball/3d457738751295b9bf6b15036578e7823919f724", + "reference": "3d457738751295b9bf6b15036578e7823919f724", "shasum": "" }, "require": { @@ -121,13 +122,13 @@ "MIT" ], "authors": [ - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - }, { "name": "Aaron Piotrowski", "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" } ], "description": "A stream abstraction to make working with non-blocking I/O simple.", @@ -140,20 +141,20 @@ "non-blocking", "stream" ], - "time": "2018-12-27T18:08:06+00:00" + "time": "2019-08-24T17:01:13+00:00" }, { "name": "aws/aws-sdk-php", - "version": "3.93.9", + "version": "3.112.24", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "047622ae51d49a89f4045c2daa138c2b47d2e089" + "reference": "6997f23a47714d084cd2d40b6348b99e10439d64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/047622ae51d49a89f4045c2daa138c2b47d2e089", - "reference": "047622ae51d49a89f4045c2daa138c2b47d2e089", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/6997f23a47714d084cd2d40b6348b99e10439d64", + "reference": "6997f23a47714d084cd2d40b6348b99e10439d64", "shasum": "" }, "require": { @@ -223,20 +224,20 @@ "s3", "sdk" ], - "time": "2019-05-14T18:16:56+00:00" + "time": "2019-10-17T18:10:45+00:00" }, { "name": "composer/xdebug-handler", - "version": "1.3.2", + "version": "1.3.3", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "d17708133b6c276d6e42ef887a877866b909d892" + "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/d17708133b6c276d6e42ef887a877866b909d892", - "reference": "d17708133b6c276d6e42ef887a877866b909d892", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/46867cbf8ca9fb8d60c506895449eb799db1184f", + "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f", "shasum": "" }, "require": { @@ -267,7 +268,7 @@ "Xdebug", "performance" ], - "time": "2019-01-28T20:25:53+00:00" + "time": "2019-05-27T17:52:04+00:00" }, { "name": "doctrine/instantiator", @@ -327,16 +328,16 @@ }, { "name": "felixfbecker/advanced-json-rpc", - "version": "v3.0.3", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", - "reference": "241c470695366e7b83672be04ea0e64d8085a551" + "reference": "23366dd0cab0a0f3fd3016bf3c0b36dec74348e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/241c470695366e7b83672be04ea0e64d8085a551", - "reference": "241c470695366e7b83672be04ea0e64d8085a551", + "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/23366dd0cab0a0f3fd3016bf3c0b36dec74348e7", + "reference": "23366dd0cab0a0f3fd3016bf3c0b36dec74348e7", "shasum": "" }, "require": { @@ -364,20 +365,20 @@ } ], "description": "A more advanced JSONRPC implementation", - "time": "2018-09-10T08:58:41+00:00" + "time": "2019-09-12T22:41:08+00:00" }, { "name": "felixfbecker/language-server-protocol", - "version": "v1.2.0", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/felixfbecker/php-language-server-protocol.git", - "reference": "1bdd1bcc95428edf85ec04c7b558d0886c07280f" + "reference": "378801f6139bb74ac215d81cca1272af61df9a9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/1bdd1bcc95428edf85ec04c7b558d0886c07280f", - "reference": "1bdd1bcc95428edf85ec04c7b558d0886c07280f", + "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/378801f6139bb74ac215d81cca1272af61df9a9f", + "reference": "378801f6139bb74ac215d81cca1272af61df9a9f", "shasum": "" }, "require": { @@ -411,7 +412,7 @@ "php", "server" ], - "time": "2018-09-25T11:42:25+00:00" + "time": "2019-06-23T21:03:50+00:00" }, { "name": "firebase/php-jwt", @@ -461,16 +462,16 @@ }, { "name": "google/auth", - "version": "v1.5.1", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/googleapis/google-auth-library-php.git", - "reference": "0f75e20e7392e863f5550ed2c2d3d50af21710fb" + "reference": "6d5455b4c0f4a58b1f1b4bdf2ba49221123698b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/0f75e20e7392e863f5550ed2c2d3d50af21710fb", - "reference": "0f75e20e7392e863f5550ed2c2d3d50af21710fb", + "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/6d5455b4c0f4a58b1f1b4bdf2ba49221123698b3", + "reference": "6d5455b4c0f4a58b1f1b4bdf2ba49221123698b3", "shasum": "" }, "require": { @@ -489,7 +490,7 @@ "sebastian/comparator": ">=1.2.3" }, "suggest": { - "phpseclib/phpseclib": "May be used in place of OpenSSL for signing strings. Please require version ^2." + "phpseclib/phpseclib": "May be used in place of OpenSSL for signing strings or for token management. Please require version ^2." }, "type": "library", "autoload": { @@ -508,35 +509,36 @@ "google", "oauth2" ], - "time": "2019-04-16T18:48:28+00:00" + "time": "2019-10-01T18:35:05+00:00" }, { "name": "google/cloud-core", - "version": "v1.28.0", + "version": "v1.33.1", "source": { "type": "git", "url": "https://github.com/googleapis/google-cloud-php-core.git", - "reference": "d32db261499d28268f9ed97834e7aca829df5b53" + "reference": "7b8773a5c6d501b3ed31655a8e243e1c17e2862e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-cloud-php-core/zipball/d32db261499d28268f9ed97834e7aca829df5b53", - "reference": "d32db261499d28268f9ed97834e7aca829df5b53", + "url": "https://api.github.com/repos/googleapis/google-cloud-php-core/zipball/7b8773a5c6d501b3ed31655a8e243e1c17e2862e", + "reference": "7b8773a5c6d501b3ed31655a8e243e1c17e2862e", "shasum": "" }, "require": { - "google/auth": "^1.5.1", + "google/auth": "^1.6", "guzzlehttp/guzzle": "^5.3|^6.0", "guzzlehttp/promises": "^1.3", "guzzlehttp/psr7": "^1.2", - "monolog/monolog": "~1", + "monolog/monolog": "^1.1|^2.0", "php": ">=5.5", "psr/http-message": "1.0.*", "rize/uri-template": "~0.3" }, "require-dev": { "erusev/parsedown": "^1.6", - "google/gax": "^1.0", + "google/common-protos": "^1.0", + "google/gax": "^1.1", "opis/closure": "^3", "phpdocumentor/reflection": "^3.0", "phpunit/phpunit": "^4.8|^5.0", @@ -568,25 +570,25 @@ "Apache-2.0" ], "description": "Google Cloud PHP shared dependency, providing functionality useful to all components.", - "time": "2019-04-16T20:44:33+00:00" + "time": "2019-10-02T20:38:25+00:00" }, { "name": "google/cloud-pubsub", - "version": "v1.12.0", + "version": "v1.18.0", "source": { "type": "git", "url": "https://github.com/googleapis/google-cloud-php-pubsub.git", - "reference": "7b391ca87735679bbc48b3d2b1cfa5fe9a2bec0a" + "reference": "c49143bf59955b1803679efc6ae854b8320f4512" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-cloud-php-pubsub/zipball/7b391ca87735679bbc48b3d2b1cfa5fe9a2bec0a", - "reference": "7b391ca87735679bbc48b3d2b1cfa5fe9a2bec0a", + "url": "https://api.github.com/repos/googleapis/google-cloud-php-pubsub/zipball/c49143bf59955b1803679efc6ae854b8320f4512", + "reference": "c49143bf59955b1803679efc6ae854b8320f4512", "shasum": "" }, "require": { - "google/cloud-core": "^1.28", - "google/gax": "^1.0" + "google/cloud-core": "^1.31", + "google/gax": "^1.1" }, "require-dev": { "erusev/parsedown": "^1.6", @@ -618,20 +620,20 @@ "Apache-2.0" ], "description": "Cloud PubSub Client for PHP", - "time": "2019-05-09T12:01:06+00:00" + "time": "2019-10-02T20:38:25+00:00" }, { "name": "google/common-protos", - "version": "1.0", + "version": "1.1", "source": { "type": "git", "url": "https://github.com/googleapis/common-protos-php.git", - "reference": "13daea6a4f257f3448fbf4450860e659462e0ad5" + "reference": "89dd797f0620b3399121b027794b18de91e1269f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/common-protos-php/zipball/13daea6a4f257f3448fbf4450860e659462e0ad5", - "reference": "13daea6a4f257f3448fbf4450860e659462e0ad5", + "url": "https://api.github.com/repos/googleapis/common-protos-php/zipball/89dd797f0620b3399121b027794b18de91e1269f", + "reference": "89dd797f0620b3399121b027794b18de91e1269f", "shasum": "" }, "require": { @@ -657,20 +659,20 @@ "keywords": [ "google" ], - "time": "2019-03-14T19:01:14+00:00" + "time": "2019-07-24T01:25:25+00:00" }, { "name": "google/gax", - "version": "1.0.2", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/googleapis/gax-php.git", - "reference": "48387fb818c6882296710a2302a0aa973b99afb2" + "reference": "4389c4103f0469f02c078250c73eaa57bdc91452" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/gax-php/zipball/48387fb818c6882296710a2302a0aa973b99afb2", - "reference": "48387fb818c6882296710a2302a0aa973b99afb2", + "url": "https://api.github.com/repos/googleapis/gax-php/zipball/4389c4103f0469f02c078250c73eaa57bdc91452", + "reference": "4389c4103f0469f02c078250c73eaa57bdc91452", "shasum": "" }, "require": { @@ -707,7 +709,7 @@ "keywords": [ "google" ], - "time": "2019-04-23T22:57:39+00:00" + "time": "2019-09-06T18:27:35+00:00" }, { "name": "google/grpc-gcp", @@ -750,16 +752,16 @@ }, { "name": "google/protobuf", - "version": "v3.7.1", + "version": "v3.10.0", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "0657d28864692480c3d8506ba4fc90e8813deae5" + "reference": "5dffdd2c84112e6c91fd84f92e3df96649426881" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/0657d28864692480c3d8506ba4fc90e8813deae5", - "reference": "0657d28864692480c3d8506ba4fc90e8813deae5", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/5dffdd2c84112e6c91fd84f92e3df96649426881", + "reference": "5dffdd2c84112e6c91fd84f92e3df96649426881", "shasum": "" }, "require": { @@ -787,20 +789,20 @@ "keywords": [ "proto" ], - "time": "2019-03-26T18:06:41+00:00" + "time": "2019-10-03T20:08:37+00:00" }, { "name": "grpc/grpc", - "version": "1.19.0", + "version": "1.22.0", "source": { "type": "git", "url": "https://github.com/grpc/grpc-php.git", - "reference": "0f1ffdde45bfb9257c5d9eab81695d0f042bea22" + "reference": "88235e786ef9b55fcb049f00c5c5202f8086a299" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/grpc/grpc-php/zipball/0f1ffdde45bfb9257c5d9eab81695d0f042bea22", - "reference": "0f1ffdde45bfb9257c5d9eab81695d0f042bea22", + "url": "https://api.github.com/repos/grpc/grpc-php/zipball/88235e786ef9b55fcb049f00c5c5202f8086a299", + "reference": "88235e786ef9b55fcb049f00c5c5202f8086a299", "shasum": "" }, "require": { @@ -828,7 +830,7 @@ "keywords": [ "rpc" ], - "time": "2019-02-27T04:47:56+00:00" + "time": "2019-07-03T19:57:39+00:00" }, { "name": "guzzlehttp/guzzle", @@ -948,33 +950,37 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.5.2", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "9f83dded91781a01c63574e387eaa769be769115" + "reference": "239400de7a173fe9901b9ac7c06497751f00727a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115", - "reference": "9f83dded91781a01c63574e387eaa769be769115", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", + "reference": "239400de7a173fe9901b9ac7c06497751f00727a", "shasum": "" }, "require": { "php": ">=5.4.0", "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5" + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" }, "provide": { "psr/http-message-implementation": "1.0" }, "require-dev": { + "ext-zlib": "*", "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" }, + "suggest": { + "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -1011,25 +1017,25 @@ "uri", "url" ], - "time": "2018-12-04T20:46:45+00:00" + "time": "2019-07-01T23:21:34+00:00" }, { "name": "monolog/monolog", - "version": "1.24.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266" + "reference": "68545165e19249013afd1d6f7485aecff07a2d22" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", - "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/68545165e19249013afd1d6f7485aecff07a2d22", + "reference": "68545165e19249013afd1d6f7485aecff07a2d22", "shasum": "" }, "require": { - "php": ">=5.3.0", - "psr/log": "~1.0" + "php": "^7.2", + "psr/log": "^1.0.1" }, "provide": { "psr/log-implementation": "1.0.0" @@ -1037,33 +1043,36 @@ "require-dev": { "aws/aws-sdk-php": "^2.4.9 || ^3.0", "doctrine/couchdb": "~1.0@dev", - "graylog2/gelf-php": "~1.0", - "jakub-onderka/php-parallel-lint": "0.9", + "elasticsearch/elasticsearch": "^6.0", + "graylog2/gelf-php": "^1.4.2", + "jakub-onderka/php-parallel-lint": "^0.9", "php-amqplib/php-amqplib": "~2.4", "php-console/php-console": "^3.1.3", - "phpunit/phpunit": "~4.5", - "phpunit/phpunit-mock-objects": "2.3.0", + "phpspec/prophecy": "^1.6.1", + "phpunit/phpunit": "^8.3", + "predis/predis": "^1.1", + "rollbar/rollbar": "^1.3", "ruflin/elastica": ">=0.90 <3.0", - "sentry/sentry": "^0.13", "swiftmailer/swiftmailer": "^5.3|^6.0" }, "suggest": { "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", - "ext-mongo": "Allow sending log messages to a MongoDB server", + "ext-mbstring": "Allow to work properly with unicode symbols", + "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", - "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", "php-console/php-console": "Allow sending log messages to Google Chrome", "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server", - "sentry/sentry": "Allow sending log messages to a Sentry server" + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.x-dev" } }, "autoload": { @@ -1089,7 +1098,7 @@ "logging", "psr-3" ], - "time": "2018-11-05T09:00:11+00:00" + "time": "2019-08-30T09:56:44+00:00" }, { "name": "mtdowling/jmespath.php", @@ -1146,74 +1155,18 @@ ], "time": "2016-12-03T22:08:25+00:00" }, - { - "name": "muglug/package-versions-56", - "version": "1.2.4", - "source": { - "type": "git", - "url": "https://github.com/muglug/PackageVersions.git", - "reference": "a67bed26deaaf9269a348e53063bc8d4dcc60ffd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/muglug/PackageVersions/zipball/a67bed26deaaf9269a348e53063bc8d4dcc60ffd", - "reference": "a67bed26deaaf9269a348e53063bc8d4dcc60ffd", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0", - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "composer/composer": "^1.3", - "ext-zip": "*", - "phpunit/phpunit": "^5.7.5" - }, - "type": "composer-plugin", - "extra": { - "class": "Muglug\\PackageVersions\\Installer", - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Muglug\\PackageVersions\\": "src/PackageVersions" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - }, - { - "name": "Abdul Malik Ikhsan", - "email": "samsonasik@gmail.com" - }, - { - "name": "Matt Brown", - "email": "github@muglug.com" - } - ], - "description": "A backport of ocramius/package-versions that supports php ^5.6. Composer plugin that provides efficient querying for installed package versions (no runtime IO)", - "time": "2018-03-26T03:22:13+00:00" - }, { "name": "myclabs/deep-copy", - "version": "1.9.1", + "version": "1.9.3", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72" + "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72", - "reference": "e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", + "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", "shasum": "" }, "require": { @@ -1248,23 +1201,27 @@ "object", "object graph" ], - "time": "2019-04-07T13:18:21+00:00" + "time": "2019-08-09T12:45:53+00:00" }, { "name": "netresearch/jsonmapper", - "version": "v1.4.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "3868fe1128ce1169228acdb623359dca74db5ef3" + "reference": "0d4d1b48d682a93b6bfedf60b88c7750e9cb0b06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/3868fe1128ce1169228acdb623359dca74db5ef3", - "reference": "3868fe1128ce1169228acdb623359dca74db5ef3", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/0d4d1b48d682a93b6bfedf60b88c7750e9cb0b06", + "reference": "0d4d1b48d682a93b6bfedf60b88c7750e9cb0b06", "shasum": "" }, "require": { + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", "php": ">=5.6" }, "require-dev": { @@ -1290,20 +1247,20 @@ } ], "description": "Map nested JSON structures onto PHP classes", - "time": "2017-11-28T21:30:01+00:00" + "time": "2019-08-15T19:41:25+00:00" }, { "name": "nikic/php-parser", - "version": "v4.2.1", + "version": "v4.2.4", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "5221f49a608808c1e4d436df32884cbc1b821ac0" + "reference": "97e59c7a16464196a8b9c77c47df68e4a39a45c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/5221f49a608808c1e4d436df32884cbc1b821ac0", - "reference": "5221f49a608808c1e4d436df32884cbc1b821ac0", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/97e59c7a16464196a8b9c77c47df68e4a39a45c4", + "reference": "97e59c7a16464196a8b9c77c47df68e4a39a45c4", "shasum": "" }, "require": { @@ -1311,7 +1268,7 @@ "php": ">=7.0" }, "require-dev": { - "phpunit/phpunit": "^6.5 || ^7.0" + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0" }, "bin": [ "bin/php-parse" @@ -1341,20 +1298,70 @@ "parser", "php" ], - "time": "2019-02-16T20:54:15+00:00" + "time": "2019-09-01T07:51:21+00:00" + }, + { + "name": "ocramius/package-versions", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/Ocramius/PackageVersions.git", + "reference": "a4d4b60d0e60da2487bd21a2c6ac089f85570dbb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/a4d4b60d0e60da2487bd21a2c6ac089f85570dbb", + "reference": "a4d4b60d0e60da2487bd21a2c6ac089f85570dbb", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": "^7.1.0" + }, + "require-dev": { + "composer/composer": "^1.6.3", + "doctrine/coding-standard": "^5.0.1", + "ext-zip": "*", + "infection/infection": "^0.7.1", + "phpunit/phpunit": "^7.0.0" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "time": "2019-02-21T12:16:21+00:00" }, { "name": "openlss/lib-array2xml", - "version": "0.5.1", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/nullivex/lib-array2xml.git", - "reference": "c8b5998a342d7861f2e921403f44e0a2f3ef2be0" + "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/c8b5998a342d7861f2e921403f44e0a2f3ef2be0", - "reference": "c8b5998a342d7861f2e921403f44e0a2f3ef2be0", + "url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", + "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", "shasum": "" }, "require": { @@ -1373,24 +1380,24 @@ "authors": [ { "name": "Bryan Tong", - "email": "contact@nullivex.com", - "homepage": "http://bryantong.com" + "email": "bryan@nullivex.com", + "homepage": "https://www.nullivex.com" }, { "name": "Tony Butler", "email": "spudz76@gmail.com", - "homepage": "http://openlss.org" + "homepage": "https://www.nullivex.com" } ], "description": "Array2XML conversion library credit to lalit.org", - "homepage": "http://openlss.org", + "homepage": "https://www.nullivex.com", "keywords": [ "array", "array conversion", "xml", "xml conversion" ], - "time": "2016-11-10T19:10:18+00:00" + "time": "2019-03-29T20:06:56+00:00" }, { "name": "pda/pheanstalk", @@ -1627,88 +1634,35 @@ ], "time": "2018-05-22T23:11:08+00:00" }, - { - "name": "php-cs-fixer/diff", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "78bb099e9c16361126c86ce82ec4405ebab8e756" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/78bb099e9c16361126c86ce82ec4405ebab8e756", - "reference": "78bb099e9c16361126c86ce82ec4405ebab8e756", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7.23 || ^6.4.3", - "symfony/process": "^3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "SpacePossum" - } - ], - "description": "sebastian/diff v2 backport support for PHP5.6", - "homepage": "https://github.com/PHP-CS-Fixer", - "keywords": [ - "diff" - ], - "time": "2018-02-15T16:58:55+00:00" - }, { "name": "phpdocumentor/reflection-common", - "version": "1.0.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", + "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", "shasum": "" }, "require": { - "php": ">=5.5" + "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "^4.6" + "phpunit/phpunit": "~6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] + "phpDocumentor\\Reflection\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1730,30 +1684,30 @@ "reflection", "static analysis" ], - "time": "2017-09-11T18:02:19+00:00" + "time": "2018-08-07T13:53:10+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.1", + "version": "4.3.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c" + "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", - "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/b83ff7cfcfee7827e1e78b637a5904fe6a96698e", + "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e", "shasum": "" }, "require": { "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0", - "phpdocumentor/type-resolver": "^0.4.0", + "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", + "phpdocumentor/type-resolver": "~0.4 || ^1.0.0", "webmozart/assert": "^1.0" }, "require-dev": { - "doctrine/instantiator": "~1.0.5", + "doctrine/instantiator": "^1.0.5", "mockery/mockery": "^1.0", "phpunit/phpunit": "^6.4" }, @@ -1781,41 +1735,40 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2019-04-30T17:48:53+00:00" + "time": "2019-09-12T14:27:41+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.4.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", + "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", - "phpdocumentor/reflection-common": "^1.0" + "php": "^7.1", + "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" + "ext-tokenizer": "^7.1", + "mockery/mockery": "~1", + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1828,7 +1781,8 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-07-14T14:27:02+00:00" + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "time": "2019-08-22T18:11:29+00:00" }, { "name": "phploc/phploc", @@ -1879,85 +1833,24 @@ "homepage": "https://github.com/sebastianbergmann/phploc", "time": "2019-03-16T10:41:19+00:00" }, - { - "name": "phpmyadmin/sql-parser", - "version": "v4.3.1", - "source": { - "type": "git", - "url": "https://github.com/phpmyadmin/sql-parser.git", - "reference": "0eb16ef5e3acacbc792be336754e42d98791a33f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpmyadmin/sql-parser/zipball/0eb16ef5e3acacbc792be336754e42d98791a33f", - "reference": "0eb16ef5e3acacbc792be336754e42d98791a33f", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "symfony/polyfill-mbstring": "^1.3" - }, - "conflict": { - "phpmyadmin/motranslator": "<3.0" - }, - "require-dev": { - "phpunit/php-code-coverage": "*", - "phpunit/phpunit": "~4.8 || ~5.7 || ~6.5", - "sami/sami": "^4.0" - }, - "suggest": { - "ext-mbstring": "For best performance", - "phpmyadmin/motranslator": "Translate messages to your favorite locale" - }, - "bin": [ - "bin/highlight-query", - "bin/lint-query" - ], - "type": "library", - "autoload": { - "psr-4": { - "PhpMyAdmin\\SqlParser\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "The phpMyAdmin Team", - "email": "developers@phpmyadmin.net", - "homepage": "https://www.phpmyadmin.net/team/" - } - ], - "description": "A validating SQL lexer and parser with a focus on MySQL dialect.", - "homepage": "https://github.com/phpmyadmin/sql-parser", - "keywords": [ - "analysis", - "lexer", - "parser", - "sql" - ], - "time": "2019-01-05T13:46:38+00:00" - }, { "name": "phpspec/prophecy", - "version": "1.8.0", + "version": "1.9.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203", + "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", "sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, @@ -1972,8 +1865,8 @@ } }, "autoload": { - "psr-0": { - "Prophecy\\": "src/" + "psr-4": { + "Prophecy\\": "src/Prophecy" } }, "notification-url": "https://packagist.org/downloads/", @@ -2001,20 +1894,20 @@ "spy", "stub" ], - "time": "2018-08-05T17:53:17+00:00" + "time": "2019-10-03T11:07:50+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "7.0.3", + "version": "7.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "0317a769a81845c390e19684d9ba25d7f6aa4707" + "reference": "aa0d179a13284c7420fc281fc32750e6cc7c9e2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/0317a769a81845c390e19684d9ba25d7f6aa4707", - "reference": "0317a769a81845c390e19684d9ba25d7f6aa4707", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/aa0d179a13284c7420fc281fc32750e6cc7c9e2f", + "reference": "aa0d179a13284c7420fc281fc32750e6cc7c9e2f", "shasum": "" }, "require": { @@ -2023,17 +1916,17 @@ "php": "^7.2", "phpunit/php-file-iterator": "^2.0.2", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.0.1", + "phpunit/php-token-stream": "^3.1.1", "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^4.1", + "sebastian/environment": "^4.2.2", "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1" + "theseer/tokenizer": "^1.1.3" }, "require-dev": { - "phpunit/phpunit": "^8.0" + "phpunit/phpunit": "^8.2.2" }, "suggest": { - "ext-xdebug": "^2.6.1" + "ext-xdebug": "^2.7.2" }, "type": "library", "extra": { @@ -2064,7 +1957,7 @@ "testing", "xunit" ], - "time": "2019-02-26T07:38:26+00:00" + "time": "2019-09-17T06:24:36+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2159,16 +2052,16 @@ }, { "name": "phpunit/php-timer", - "version": "2.1.1", + "version": "2.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "8b389aebe1b8b0578430bda0c7c95a829608e059" + "reference": "1038454804406b0b5f5f520358e78c1c2f71501e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/8b389aebe1b8b0578430bda0c7c95a829608e059", - "reference": "8b389aebe1b8b0578430bda0c7c95a829608e059", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e", + "reference": "1038454804406b0b5f5f520358e78c1c2f71501e", "shasum": "" }, "require": { @@ -2204,20 +2097,20 @@ "keywords": [ "timer" ], - "time": "2019-02-20T10:12:59+00:00" + "time": "2019-06-07T04:22:29+00:00" }, { "name": "phpunit/php-token-stream", - "version": "3.0.1", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "c99e3be9d3e85f60646f152f9002d46ed7770d18" + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/c99e3be9d3e85f60646f152f9002d46ed7770d18", - "reference": "c99e3be9d3e85f60646f152f9002d46ed7770d18", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", "shasum": "" }, "require": { @@ -2230,7 +2123,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -2253,46 +2146,47 @@ "keywords": [ "tokenizer" ], - "time": "2018-10-30T05:52:18+00:00" + "time": "2019-09-17T06:23:10+00:00" }, { "name": "phpunit/phpunit", - "version": "8.1.5", + "version": "8.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "01392d4b5878aa617e8d9bc7a529e5febc8fe956" + "reference": "366a4a0f2b971fd43b7c351d621e8dd7d7131869" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/01392d4b5878aa617e8d9bc7a529e5febc8fe956", - "reference": "01392d4b5878aa617e8d9bc7a529e5febc8fe956", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/366a4a0f2b971fd43b7c351d621e8dd7d7131869", + "reference": "366a4a0f2b971fd43b7c351d621e8dd7d7131869", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.1", + "doctrine/instantiator": "^1.2.0", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.7", - "phar-io/manifest": "^1.0.2", - "phar-io/version": "^2.0", + "myclabs/deep-copy": "^1.9.1", + "phar-io/manifest": "^1.0.3", + "phar-io/version": "^2.0.1", "php": "^7.2", - "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^7.0", - "phpunit/php-file-iterator": "^2.0.1", + "phpspec/prophecy": "^1.8.1", + "phpunit/php-code-coverage": "^7.0.7", + "phpunit/php-file-iterator": "^2.0.2", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1", - "sebastian/comparator": "^3.0", - "sebastian/diff": "^3.0", - "sebastian/environment": "^4.1", - "sebastian/exporter": "^3.1", - "sebastian/global-state": "^3.0", + "phpunit/php-timer": "^2.1.2", + "sebastian/comparator": "^3.0.2", + "sebastian/diff": "^3.0.2", + "sebastian/environment": "^4.2.2", + "sebastian/exporter": "^3.1.1", + "sebastian/global-state": "^3.0.0", "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0", + "sebastian/resource-operations": "^2.0.1", + "sebastian/type": "^1.1.3", "sebastian/version": "^2.0.1" }, "require-dev": { @@ -2301,7 +2195,7 @@ "suggest": { "ext-soap": "*", "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0" + "phpunit/php-invoker": "^2.0.0" }, "bin": [ "phpunit" @@ -2309,7 +2203,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "8.1-dev" + "dev-master": "8.4-dev" } }, "autoload": { @@ -2335,7 +2229,7 @@ "testing", "xunit" ], - "time": "2019-05-14T04:57:31+00:00" + "time": "2019-10-07T12:57:41+00:00" }, { "name": "predis/predis", @@ -2433,6 +2327,55 @@ ], "time": "2016-08-06T20:24:11+00:00" }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, { "name": "psr/http-message", "version": "1.0.1", @@ -2532,24 +2475,24 @@ }, { "name": "ralouphie/getallheaders", - "version": "2.0.5", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" + "reference": "120b605dfeb996808c31b6477290a714d356e822" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", - "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", "shasum": "" }, "require": { - "php": ">=5.3" + "php": ">=5.6" }, "require-dev": { - "phpunit/phpunit": "~3.7.0", - "satooshi/php-coveralls": ">=1.0" + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" }, "type": "library", "autoload": { @@ -2568,7 +2511,7 @@ } ], "description": "A polyfill for getallheaders.", - "time": "2016-02-11T07:05:27+00:00" + "time": "2019-03-08T08:55:37+00:00" }, { "name": "rize/uri-template", @@ -2834,16 +2777,16 @@ }, { "name": "sebastian/exporter", - "version": "3.1.0", + "version": "3.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", "shasum": "" }, "require": { @@ -2870,6 +2813,10 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" @@ -2878,17 +2825,13 @@ "name": "Volker Dusch", "email": "github@wallbash.com" }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, { "name": "Adam Harvey", "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], "description": "Provides the functionality to export PHP variables for visualization", @@ -2897,7 +2840,7 @@ "export", "exporter" ], - "time": "2017-04-03T13:19:02+00:00" + "time": "2019-09-14T09:02:43+00:00" }, { "name": "sebastian/finder-facade", @@ -3179,6 +3122,52 @@ "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "time": "2018-10-04T04:07:39+00:00" }, + { + "name": "sebastian/type", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/3aaaa15fa71d27650d62a948be022fe3b48541a3", + "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3", + "shasum": "" + }, + "require": { + "php": "^7.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.2" + }, + "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", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "time": "2019-07-02T08:10:15+00:00" + }, { "name": "sebastian/version", "version": "2.0.1", @@ -3224,16 +3213,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.4.2", + "version": "3.5.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8" + "reference": "82cd0f854ceca17731d6d019c7098e3755c45060" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", - "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/82cd0f854ceca17731d6d019c7098e3755c45060", + "reference": "82cd0f854ceca17731d6d019c7098e3755c45060", "shasum": "" }, "require": { @@ -3271,20 +3260,20 @@ "phpcs", "standards" ], - "time": "2019-04-10T23:49:02+00:00" + "time": "2019-10-16T21:14:26+00:00" }, { "name": "symfony/config", - "version": "v4.2.8", + "version": "v4.3.5", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "0e745ead307d5dcd4e163e94a47ec04b1428943f" + "reference": "0acb26407a9e1a64a275142f0ae5e36436342720" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/0e745ead307d5dcd4e163e94a47ec04b1428943f", - "reference": "0e745ead307d5dcd4e163e94a47ec04b1428943f", + "url": "https://api.github.com/repos/symfony/config/zipball/0acb26407a9e1a64a275142f0ae5e36436342720", + "reference": "0acb26407a9e1a64a275142f0ae5e36436342720", "shasum": "" }, "require": { @@ -3299,6 +3288,7 @@ "symfony/dependency-injection": "~3.4|~4.0", "symfony/event-dispatcher": "~3.4|~4.0", "symfony/finder": "~3.4|~4.0", + "symfony/messenger": "~4.1", "symfony/yaml": "~3.4|~4.0" }, "suggest": { @@ -3307,7 +3297,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -3334,29 +3324,31 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2019-04-01T14:03:25+00:00" + "time": "2019-09-19T15:51:53+00:00" }, { "name": "symfony/console", - "version": "v4.2.8", + "version": "v4.3.5", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "e2840bb38bddad7a0feaf85931e38fdcffdb2f81" + "reference": "929ddf360d401b958f611d44e726094ab46a7369" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/e2840bb38bddad7a0feaf85931e38fdcffdb2f81", - "reference": "e2840bb38bddad7a0feaf85931e38fdcffdb2f81", + "url": "https://api.github.com/repos/symfony/console/zipball/929ddf360d401b958f611d44e726094ab46a7369", + "reference": "929ddf360d401b958f611d44e726094ab46a7369", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/contracts": "^1.0", - "symfony/polyfill-mbstring": "~1.0" + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/service-contracts": "^1.1" }, "conflict": { "symfony/dependency-injection": "<3.4", + "symfony/event-dispatcher": "<4.3", "symfony/process": "<3.3" }, "provide": { @@ -3366,9 +3358,10 @@ "psr/log": "~1.0", "symfony/config": "~3.4|~4.0", "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/event-dispatcher": "^4.3", "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.4|~4.0" + "symfony/process": "~3.4|~4.0", + "symfony/var-dumper": "^4.3" }, "suggest": { "psr/log": "For using the console logger", @@ -3379,7 +3372,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -3406,51 +3399,38 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-04-08T14:23:48+00:00" + "time": "2019-10-07T12:36:49+00:00" }, { - "name": "symfony/contracts", - "version": "v1.1.0", + "name": "symfony/filesystem", + "version": "v4.3.5", "source": { "type": "git", - "url": "https://github.com/symfony/contracts.git", - "reference": "d3636025e8253c6144358ec0a62773cae588395b" + "url": "https://github.com/symfony/filesystem.git", + "reference": "9abbb7ef96a51f4d7e69627bc6f63307994e4263" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/contracts/zipball/d3636025e8253c6144358ec0a62773cae588395b", - "reference": "d3636025e8253c6144358ec0a62773cae588395b", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/9abbb7ef96a51f4d7e69627bc6f63307994e4263", + "reference": "9abbb7ef96a51f4d7e69627bc6f63307994e4263", "shasum": "" }, "require": { - "php": "^7.1.3" - }, - "require-dev": { - "psr/cache": "^1.0", - "psr/container": "^1.0", - "symfony/polyfill-intl-idn": "^1.10" - }, - "suggest": { - "psr/cache": "When using the Cache contracts", - "psr/container": "When using the Service contracts", - "symfony/cache-contracts-implementation": "", - "symfony/event-dispatcher-implementation": "", - "symfony/http-client-contracts-implementation": "", - "symfony/service-contracts-implementation": "", - "symfony/translation-contracts-implementation": "" + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "4.3-dev" } }, "autoload": { "psr-4": { - "Symfony\\Contracts\\": "" + "Symfony\\Component\\Filesystem\\": "" }, "exclude-from-classmap": [ - "**/Tests/" + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -3459,53 +3439,44 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "A set of abstractions extracted out of the Symfony components", + "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "time": "2019-04-27T14:29:50+00:00" + "time": "2019-08-20T14:07:54+00:00" }, { - "name": "symfony/filesystem", - "version": "v4.2.8", + "name": "symfony/finder", + "version": "v4.3.5", "source": { "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "e16b9e471703b2c60b95f14d31c1239f68f11601" + "url": "https://github.com/symfony/finder.git", + "reference": "5e575faa95548d0586f6bedaeabec259714e44d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/e16b9e471703b2c60b95f14d31c1239f68f11601", - "reference": "e16b9e471703b2c60b95f14d31c1239f68f11601", + "url": "https://api.github.com/repos/symfony/finder/zipball/5e575faa95548d0586f6bedaeabec259714e44d1", + "reference": "5e575faa95548d0586f6bedaeabec259714e44d1", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/polyfill-ctype": "~1.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Filesystem\\": "" + "Symfony\\Component\\Finder\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -3525,39 +3496,42 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Filesystem Component", + "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-02-07T11:40:08+00:00" + "time": "2019-09-16T11:29:48+00:00" }, { - "name": "symfony/finder", - "version": "v4.2.8", + "name": "symfony/polyfill-ctype", + "version": "v1.12.0", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "e45135658bd6c14b61850bf131c4f09a55133f69" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "550ebaac289296ce228a706d0867afc34687e3f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/e45135658bd6c14b61850bf131c4f09a55133f69", - "reference": "e45135658bd6c14b61850bf131c4f09a55133f69", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", + "reference": "550ebaac289296ce228a706d0867afc34687e3f4", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "1.12-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Finder\\": "" + "Symfony\\Polyfill\\Ctype\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -3566,47 +3540,53 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Finder Component", + "description": "Symfony polyfill for ctype functions", "homepage": "https://symfony.com", - "time": "2019-04-06T13:51:08+00:00" + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2019-08-06T08:03:45+00:00" }, { - "name": "symfony/polyfill-ctype", - "version": "v1.11.0", + "name": "symfony/polyfill-mbstring", + "version": "v1.12.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "82ebae02209c21113908c229e9883c419720738a" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a", - "reference": "82ebae02209c21113908c229e9883c419720738a", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", + "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", "shasum": "" }, "require": { "php": ">=5.3.3" }, "suggest": { - "ext-ctype": "For best performance" + "ext-mbstring": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11-dev" + "dev-master": "1.12-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" + "Symfony\\Polyfill\\Mbstring\\": "" }, "files": [ "bootstrap.php" @@ -3618,53 +3598,51 @@ ], "authors": [ { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for ctype functions", + "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "ctype", + "mbstring", "polyfill", - "portable" + "portable", + "shim" ], - "time": "2019-02-06T07:57:58+00:00" + "time": "2019-08-06T08:03:45+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.11.0", + "name": "symfony/polyfill-php72", + "version": "v1.12.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "fe5e94c604826c35a32fa832f35bd036b6799609" + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "04ce3335667451138df4307d6a9b61565560199e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fe5e94c604826c35a32fa832f35bd036b6799609", - "reference": "fe5e94c604826c35a32fa832f35bd036b6799609", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/04ce3335667451138df4307d6a9b61565560199e", + "reference": "04ce3335667451138df4307d6a9b61565560199e", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "suggest": { - "ext-mbstring": "For best performance" - }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11-dev" + "dev-master": "1.12-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" + "Symfony\\Polyfill\\Php72\\": "" }, "files": [ "bootstrap.php" @@ -3684,29 +3662,28 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for the Mbstring extension", + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "mbstring", "polyfill", "portable", "shim" ], - "time": "2019-02-06T07:57:58+00:00" + "time": "2019-08-06T08:03:45+00:00" }, { - "name": "symfony/polyfill-php72", - "version": "v1.11.0", + "name": "symfony/polyfill-php73", + "version": "v1.12.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "ab50dcf166d5f577978419edd37aa2bb8eabce0c" + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/ab50dcf166d5f577978419edd37aa2bb8eabce0c", - "reference": "ab50dcf166d5f577978419edd37aa2bb8eabce0c", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/2ceb49eaccb9352bff54d22570276bb75ba4a188", + "reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188", "shasum": "" }, "require": { @@ -3715,15 +3692,18 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11-dev" + "dev-master": "1.12-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" + "Symfony\\Polyfill\\Php73\\": "" }, "files": [ "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -3740,7 +3720,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -3748,30 +3728,88 @@ "portable", "shim" ], - "time": "2019-02-06T07:57:58+00:00" + "time": "2019-08-06T08:03:45+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v1.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "ffcde9615dc5bb4825b9f6aed07716f1f57faae0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ffcde9615dc5bb4825b9f6aed07716f1f57faae0", + "reference": "ffcde9615dc5bb4825b9f6aed07716f1f57faae0", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "psr/container": "^1.0" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2019-09-17T11:12:18+00:00" }, { "name": "symfony/stopwatch", - "version": "v4.2.8", + "version": "v4.3.5", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "b1a5f646d56a3290230dbc8edf2a0d62cda23f67" + "reference": "1e4ff456bd625be5032fac9be4294e60442e9b71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/b1a5f646d56a3290230dbc8edf2a0d62cda23f67", - "reference": "b1a5f646d56a3290230dbc8edf2a0d62cda23f67", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/1e4ff456bd625be5032fac9be4294e60442e9b71", + "reference": "1e4ff456bd625be5032fac9be4294e60442e9b71", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/contracts": "^1.0" + "symfony/service-contracts": "^1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -3798,20 +3836,20 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2019-01-16T20:31:39+00:00" + "time": "2019-08-07T11:52:19+00:00" }, { "name": "symfony/var-dumper", - "version": "v4.2.8", + "version": "v4.3.5", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "3c4084cb1537c0e2ad41aad622bbf55a44a5c9ce" + "reference": "bde8957fc415fdc6964f33916a3755737744ff05" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/3c4084cb1537c0e2ad41aad622bbf55a44a5c9ce", - "reference": "3c4084cb1537c0e2ad41aad622bbf55a44a5c9ce", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/bde8957fc415fdc6964f33916a3755737744ff05", + "reference": "bde8957fc415fdc6964f33916a3755737744ff05", "shasum": "" }, "require": { @@ -3840,7 +3878,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -3874,20 +3912,20 @@ "debug", "dump" ], - "time": "2019-05-01T12:55:36+00:00" + "time": "2019-10-04T19:48:13+00:00" }, { "name": "symfony/yaml", - "version": "v4.2.8", + "version": "v4.3.5", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "6712daf03ee25b53abb14e7e8e0ede1a770efdb1" + "reference": "41e16350a2a1c7383c4735aa2f9fce74cf3d1178" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/6712daf03ee25b53abb14e7e8e0ede1a770efdb1", - "reference": "6712daf03ee25b53abb14e7e8e0ede1a770efdb1", + "url": "https://api.github.com/repos/symfony/yaml/zipball/41e16350a2a1c7383c4735aa2f9fce74cf3d1178", + "reference": "41e16350a2a1c7383c4735aa2f9fce74cf3d1178", "shasum": "" }, "require": { @@ -3906,7 +3944,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -3933,7 +3971,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-03-30T15:58:42+00:00" + "time": "2019-09-11T15:41:19+00:00" }, { "name": "theseer/fdomdocument", @@ -3977,16 +4015,16 @@ }, { "name": "theseer/tokenizer", - "version": "1.1.2", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "1c42705be2b6c1de5904f8afacef5895cab44bf8" + "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/1c42705be2b6c1de5904f8afacef5895cab44bf8", - "reference": "1c42705be2b6c1de5904f8afacef5895cab44bf8", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", "shasum": "" }, "require": { @@ -4013,20 +4051,20 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2019-04-04T09:56:43+00:00" + "time": "2019-06-13T22:48:21+00:00" }, { "name": "vimeo/psalm", - "version": "3.2.12", + "version": "3.6.1", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "fe0f352132f798512ced19faf75cbfc84e4aabe7" + "reference": "7857b07f91bed5afae98574243fed7ec4088d623" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/fe0f352132f798512ced19faf75cbfc84e4aabe7", - "reference": "fe0f352132f798512ced19faf75cbfc84e4aabe7", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/7857b07f91bed5afae98574243fed7ec4088d623", + "reference": "7857b07f91bed5afae98574243fed7ec4088d623", "shasum": "" }, "require": { @@ -4034,14 +4072,13 @@ "amphp/byte-stream": "^1.5", "composer/xdebug-handler": "^1.1", "felixfbecker/advanced-json-rpc": "^3.0.3", - "felixfbecker/language-server-protocol": "^1.2", - "muglug/package-versions-56": "1.2.4", + "felixfbecker/language-server-protocol": "^1.4", "netresearch/jsonmapper": "^1.0", - "nikic/php-parser": "^4.0.2 || ^4.1", - "openlss/lib-array2xml": "^0.0.10||^0.5.1", - "php": "^7.0", - "php-cs-fixer/diff": "^1.2", - "phpmyadmin/sql-parser": "^4.0", + "nikic/php-parser": "^4.2", + "ocramius/package-versions": "^1.2", + "openlss/lib-array2xml": "^1.0", + "php": "^7.1.3", + "sebastian/diff": "^3.0", "symfony/console": "^3.3||^4.0", "webmozart/glob": "^4.1", "webmozart/path-util": "^2.3" @@ -4051,9 +4088,14 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.2", - "phpunit/phpunit": "^6.0 || ^7.0", - "psalm/plugin-phpunit": "^0.5.5", - "squizlabs/php_codesniffer": "3.4.0" + "ext-curl": "*", + "friendsofphp/php-cs-fixer": "^2.15", + "phpmyadmin/sql-parser": "^5.0", + "phpunit/phpunit": "^7.5 || ^8.0", + "psalm/plugin-phpunit": "^0.6", + "slevomat/coding-standard": "^5.0", + "squizlabs/php_codesniffer": "3.4.0", + "symfony/process": "^4.3" }, "suggest": { "ext-igbinary": "^2.0.5" @@ -4062,7 +4104,8 @@ "psalm", "psalter", "psalm-language-server", - "psalm-plugin" + "psalm-plugin", + "psalm-refactor" ], "type": "library", "extra": { @@ -4076,7 +4119,10 @@ "psr-4": { "Psalm\\Plugin\\": "src/Psalm/Plugin", "Psalm\\": "src/Psalm" - } + }, + "files": [ + "src/functions.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -4093,20 +4139,20 @@ "inspection", "php" ], - "time": "2019-05-13T15:00:17+00:00" + "time": "2019-10-11T12:24:35+00:00" }, { "name": "webmozart/assert", - "version": "1.4.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" + "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", - "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", + "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", + "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", "shasum": "" }, "require": { @@ -4114,8 +4160,7 @@ "symfony/polyfill-ctype": "^1.8" }, "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" + "phpunit/phpunit": "^4.8.36 || ^7.5.13" }, "type": "library", "extra": { @@ -4144,7 +4189,7 @@ "check", "validate" ], - "time": "2018-12-25T11:19:39+00:00" + "time": "2019-08-24T08:43:50+00:00" }, { "name": "webmozart/glob", @@ -4246,7 +4291,8 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.0" + "php": ">=7.2", + "ext-json": "*" }, "platform-dev": [] } diff --git a/release b/release deleted file mode 100755 index 861dc52..0000000 --- a/release +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env php -name}\n* {$composer->description}\n*\n"; - -$currentVersion = file_get_contents('VERSION'); -echo "\nCurrent version: {$currentVersion}\n"; - -$input = fopen("php://stdin", "r"); - -if( isset($argv[1]) ) { - $version = $argv[1]; - echo "New version: {$version}\n\n"; - -} else { - echo "New version: "; - $version = trim(fgets($input)); - echo "\n"; -} - -if( empty($version) ){ - echo "Invalid version number.\nAborting.\n\n"; - exit; -} - -echo "Are you sure you want to do this? Type 'yes' to continue: "; -if( strtolower(trim(fgets($input))) !== 'yes' ){ - echo "Aborting.\n\n"; - exit; -} - -// Update composer.json file with latest version number -$composer->version = (string) $version; -file_put_contents('composer.json', json_encode($composer, JSON_PRETTY_PRINT)); - -// Write version number to disk -file_put_contents('VERSION', $version); - -// Commit & push changes, tag commit and push again -exec("git commit -am \"Tagging version {$version}\""); -exec("git push"); -exec("git tag {$version}"); -exec("git push --tags"); \ No newline at end of file diff --git a/src/DispatchException.php b/src/DispatchException.php new file mode 100644 index 0000000..627fb2a --- /dev/null +++ b/src/DispatchException.php @@ -0,0 +1,37 @@ +queueMessage = $message; + } + + /** + * Get the Message instance that could be dispatched. + * + * @return Message|null + */ + public function getQueueMessage(): ?Message + { + return $this->queueMessage; + } +} \ No newline at end of file diff --git a/src/Dispatcher.php b/src/Dispatcher.php index 5b84181..2c55bf2 100644 --- a/src/Dispatcher.php +++ b/src/Dispatcher.php @@ -3,10 +3,8 @@ namespace Syndicate; use Syndicate\Message; -use Syndicate\Queue\Queue; use Syndicate\Router; - class Dispatcher { /** @@ -51,75 +49,70 @@ public function setDefaultHandler(callable $defaultHandler): void $this->defaultHandler = $defaultHandler; } - /** - * Listen on a Queue for new messages to be dispatched. - * - * This is a blocking call. - * - * @param Queue $queue - * @return void - */ - public function listen(Queue $queue): void - { - $queue->listen(function(Message $message): void { - - $this->dispatch($message); - - }); - } - /** * Dispatch the given Message. - * - * Throws an exception if no route can be found and no defaultHandler was given. + * + * Throws a DispatchException if no route can be found and no defaultHandler was given. * * @param Message $message - * @throws \Exception + * @throws DispatchException * @return void */ public function dispatch(Message $message): void { - // No handler could be resolved, fallback to defaultHandler. - if( ($handler = $this->router->resolve($message)) === null ){ - $handler = $this->defaultHandler; + /** @var string|array|null $handler */ + $handler = $this->router->resolve($message); + + if( empty($handler) ){ + $handler = $this->defaultHandler; + + if( empty($handler) ){ + $dispatchException = new DispatchException("Cannot resolve handler and no default handler defined."); + $dispatchException->setQueueMessage($message); + throw $dispatchException; + } } - $handlers = $this->resolveHandlers($handler); + $callableHandlers = $this->makeHandlersCallable($handler); - if( empty($handlers) ){ - throw new \Exception("Cannot resolve handler."); + if( empty($callableHandlers) ){ + $dispatchException = new DispatchException("Cannot resolve handlers into callables."); + $dispatchException->setQueueMessage($message); + throw $dispatchException; } - foreach( $handlers as $handler ){ - \call_user_func($handler, $message); + foreach( $callableHandlers as $callableHandler ){ + \call_user_func($callableHandler, $message); } } /** - * Try and resolve the handler type into a callable. + * Try and resolve the handler(s) into an array of callables. * * @param string|array|callable $handlers * @return array */ - private function resolveHandlers($handlers): array + private function makeHandlersCallable($handlers): array { if( !\is_array($handlers) ){ $handlers = [$handlers]; } - $callables = []; - - foreach( $handlers as $handler ){ + /** + * @var array $callables + * @psalm-suppress MissingClosureParamType + */ + $callables = \array_reduce($handlers, function(array $callables, $handler): array { if( \is_callable($handler) ){ $callables[] = $handler; } - - // Could be of the format ClassName@MethodName or ClassName::MethodName - if( \is_string($handler) ){ - + + elseif( \is_string($handler) ){ + + // Could be of the format ClassName@MethodName or ClassName::MethodName if( \preg_match("/^(.+)\@(.+)$/", $handler, $match) ){ - + if( ($instance = $this->getFromHandlerCache($match[1])) == false ){ /** @@ -128,12 +121,14 @@ private function resolveHandlers($handlers): array $instance = new $match[1]; $this->putInHandlerCache($match[1], $instance); } - + $callables[] = [$instance, $match[2]]; } } - } + return $callables; + + }, []); return $callables; } diff --git a/src/Message.php b/src/Message.php index 0a893a0..08c8c20 100644 --- a/src/Message.php +++ b/src/Message.php @@ -14,14 +14,14 @@ class Message protected $queue; /** - * Source message object/data. + * Source message data. * * @var mixed */ protected $sourceMessage; /** - * The payload of the message. + * The parsed/decoded payload of the source message. * * @var mixed */ diff --git a/src/MessageTransformer.php b/src/MessageTransformer.php index 8564fe8..ab512db 100644 --- a/src/MessageTransformer.php +++ b/src/MessageTransformer.php @@ -18,7 +18,6 @@ abstract class MessageTransformer */ protected $deserializer; - /** * Set the serializer. * diff --git a/src/PubSub/PubSubAbstract.php b/src/PubSub/PubSubAbstract.php deleted file mode 100644 index ec10d14..0000000 --- a/src/PubSub/PubSubAbstract.php +++ /dev/null @@ -1,45 +0,0 @@ - - * @param callable $defaultHandler - * @return void - */ - abstract public function subscribe(array $subscriptions, callable $defaultHandler = null): void; -} \ No newline at end of file diff --git a/src/PubSub/Redis.php b/src/PubSub/Redis.php deleted file mode 100644 index f8965a1..0000000 --- a/src/PubSub/Redis.php +++ /dev/null @@ -1,87 +0,0 @@ -client = $redis; - } - - /** - * @inheritDoc - */ - public function publish(string $topic, string $data, array $options = []): void - { - $this->client->publish($topic, $this->serialize($data)); - } - - /** - *@inheritDoc - */ - public function listen(string $topic, callable $handler, array $options = []): void - { - $self = $this; - - $this->client->pubSubLoop(['subscribe' => $topic], function(Consumer $consumer, object $message) use ($self, $handler): void { - - if( $message->kind === "message" ){ - - $handler( - new Message($message, $self->deserialize($message->payload)) - ); - } - - }); - } - - /** - * @inheritDoc - */ - public function subscribe(array $subscriptions, callable $defaultHandler = null): void - { - $consumer = $this->client->pubSubLoop(); - $dispatcherLoop = new DispatcherLoop($consumer); - - $self = $this; - - foreach( $subscriptions as $topic => $handler ){ - - $dispatcherLoop->attachCallback($topic, function(string $message) use ($self, $handler): void { - - $handler( - new Message($message, $self->deserialize($message)) - ); - - }); - } - - if( $defaultHandler ){ - $dispatcherLoop->defaultCallback(function(object $message) use ($self, $defaultHandler): void { - - $defaultHandler( - new Message($message, $self->deserialize($message->payload)) - ); - - }); - } - - $dispatcherLoop->run(); - } -} \ No newline at end of file diff --git a/src/PubSub/Sns.php b/src/PubSub/Sns.php deleted file mode 100644 index 4e7a31f..0000000 --- a/src/PubSub/Sns.php +++ /dev/null @@ -1,46 +0,0 @@ -client = $snsClient; - } - - /** - * @inheritDoc - */ - public function publish(string $topic, string $data, array $options = []): void - { - $this->client->publish([ - "TopicArn" => $topic, - "Message" => $this->serialize($data) - ]); - } - - /** - * @inheritDoc - */ - public function listen(string $topic, callable $handler, array $options = []): void - { - return; - } - - /** - * @inheritDoc - */ - public function subscribe(array $subscriptions, callable $defaultHandler = null): void - { - return; - } -} \ No newline at end of file diff --git a/src/Queue/Beanstalk.php b/src/Queue/Beanstalk.php index 38d7b38..06a5ec3 100644 --- a/src/Queue/Beanstalk.php +++ b/src/Queue/Beanstalk.php @@ -2,15 +2,15 @@ namespace Syndicate\Queue; -use Pheanstalk\Job; use Pheanstalk\Pheanstalk; -use Syndicate\Queue\Queue; +use Pheanstalk\PheanstalkInterface; use Syndicate\Message; +use Syndicate\Queue\Queue; /** - * + * * @property Pheanstalk $client - * + * */ class Beanstalk extends Queue { @@ -34,9 +34,9 @@ public function put($data, array $options = []): void $this->client->putInTube( $this->name, $this->serialize($data), - $options['priority'] ?? null, - $options['delay'] ?? null, - $options['ttr'] ?? null + $options['priority'] ?? PheanstalkInterface::DEFAULT_PRIORITY, + $options['delay'] ?? PheanstalkInterface::DEFAULT_DELAY, + $options['ttr'] ?? PheanstalkInterface::DEFAULT_TTR ); } @@ -45,16 +45,13 @@ public function put($data, array $options = []): void */ public function get(array $options = []): ?Message { - $job = $this->client->reserveFromTube( - $this->name, - $options['timeout'] ?? null - ); + $message = $this->many(1, $options); - $payload = $this->deserialize( - $job->getData() - ); + if( empty($message) ){ + return null; + } - return new Message($this, $job, $payload); + return $message[0]; } /** @@ -62,7 +59,23 @@ public function get(array $options = []): ?Message */ public function many(int $max, array $options = []): array { - return []; + $job = $this->client->reserveFromTube( + $this->name, + $options['timeout'] ?? null + ); + + /** @psalm-suppress DocblockTypeContradiction */ + if( empty($job) ){ + return []; + } + + $payload = $this->deserialize( + $job->getData() + ); + + return [ + new Message($this, $job, $payload) + ]; } /** @@ -72,8 +85,8 @@ public function release(Message $message, array $options = []): void { $this->client->release( $message->getSourceMessage(), - $options['priority'] ?? null, - $options['delay'] ?? null + $options['priority'] ?? PheanstalkInterface::DEFAULT_PRIORITY, + $options['delay'] ?? PheanstalkInterface::DEFAULT_DELAY ); } diff --git a/src/Queue/Google.php b/src/Queue/Google.php index ea86d2c..32435fd 100644 --- a/src/Queue/Google.php +++ b/src/Queue/Google.php @@ -9,9 +9,9 @@ use Syndicate\Queue\Queue; /** - * + * * @property PubSubClient $client - * + * */ class Google extends Queue { @@ -79,7 +79,7 @@ public function many(int $max, array $options = []): array $payload = $this->deserialize( $message->data() ); - + $messages[] = new Message($this, $message, $payload); } diff --git a/src/Queue/Queue.php b/src/Queue/Queue.php index 3697de1..52faced 100644 --- a/src/Queue/Queue.php +++ b/src/Queue/Queue.php @@ -2,11 +2,9 @@ namespace Syndicate\Queue; -use Psr\Log\LoggerInterface; use Syndicate\Message; use Syndicate\MessageTransformer; - abstract class Queue extends MessageTransformer { /** @@ -23,6 +21,13 @@ abstract class Queue extends MessageTransformer */ protected $client; + /** + * Flag signaling the queue should continue to run. + * + * @var boolean + */ + protected $shouldRun = true; + /** * Put data on the queue * @@ -66,6 +71,16 @@ abstract public function delete(Message $message): void; */ abstract public function release(Message $message, array $options = []): void; + /** + * Cease processing messages. + * + * @return void + */ + public function shutdown(): void + { + $this->shouldRun = false; + } + /** * Block listen for new messages on queue. Executes callback on new Message arrival. * @@ -83,8 +98,10 @@ public function listen(callable $callback, int $pollingTimeout = 20): void $callback($message); } + \pcntl_signal_dispatch(); + } - while(true); + while($this->shouldRun); } /** diff --git a/src/Queue/Redis.php b/src/Queue/Redis.php index 9de131c..7b00c3e 100644 --- a/src/Queue/Redis.php +++ b/src/Queue/Redis.php @@ -5,11 +5,10 @@ use Predis\Client; use Syndicate\Message; - /** - * + * * @property Client $client - * + * */ class Redis extends Queue { @@ -41,7 +40,7 @@ public function get(array $options = []): ?Message $messages = $this->many(1, $options); return $messages[0] ?? null; } - + /** * @inheritDoc */ @@ -50,9 +49,9 @@ public function many(int $max, array $options = []): array $messages = []; for( $i = 0; $i < $max; $i++ ){ - - if( ($message = $this->client->blpop($this->name, 0)) ){ - $messages[] = new Message($this, $message[1], $this->deserialize($message[1])); + + if( ($message = $this->client->blpop($this->name, (int) ($options['timeout'] ?? 0))) ){ + $messages[] = new Message($this, $message[1], $this->deserialize($message[1])); } } diff --git a/src/Queue/RedisPubSub.php b/src/Queue/RedisPubSub.php index 665e1c3..5f90c4a 100644 --- a/src/Queue/RedisPubSub.php +++ b/src/Queue/RedisPubSub.php @@ -8,9 +8,9 @@ use Syndicate\Message; /** - * + * * @property Client $client - * + * */ class RedisPubSub extends Queue { @@ -87,10 +87,11 @@ public function listen(callable $callback, int $pollingTimeout = 20): void { $self = $this; + /** @psalm-suppress TooManyArguments */ $this->client->pubSubLoop(['subscribe' => $this->name], function(Consumer $consumer, object $message) use ($callback, $self): void { if( $message->kind === "message" ){ - + $callback( new Message($self, $message, $self->deserialize($message->payload)) ); diff --git a/src/Queue/Sqs.php b/src/Queue/Sqs.php index 5e720aa..a003dc9 100644 --- a/src/Queue/Sqs.php +++ b/src/Queue/Sqs.php @@ -7,9 +7,9 @@ use Syndicate\Message; /** - * + * * @property SqsClient $client - * + * */ class Sqs extends Queue { diff --git a/src/Router.php b/src/Router.php index 5d98689..0e40579 100644 --- a/src/Router.php +++ b/src/Router.php @@ -34,7 +34,7 @@ public function __construct(callable $resolver, array $routes = []) /** * Match the Message to a route handler. - * + * * Returns a handler on successful route match. * * @param Message $message diff --git a/tests/DispatcherTest.php b/tests/DispatcherTest.php index aa497a1..17e558f 100644 --- a/tests/DispatcherTest.php +++ b/tests/DispatcherTest.php @@ -1,9 +1,10 @@ expectException(\Exception::class); + $this->expectException(DispatchException::class); $dispatcher->dispatch($queue->get()); } } \ No newline at end of file