From 38579005c0492c0275bbae31170edf30a7e740fa Mon Sep 17 00:00:00 2001 From: Alexander Kozienko Date: Thu, 10 Aug 2017 14:24:15 +0300 Subject: [PATCH 01/60] require php from 5.5 --- composer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/composer.json b/composer.json index 9ac5eb8..ed58ae0 100644 --- a/composer.json +++ b/composer.json @@ -5,6 +5,9 @@ "keywords": ["messaging", "queue", "jms", "mq", "message queue"], "homepage": "https://github.com/queue-interop/queue-interop", "license": "MIT", + "require": { + "php": ">=5.5" + }, "autoload": { "psr-4": { "Interop\\Queue\\": "src/" From 1c6e5b54811ebd9b53838195d80e1a9262a5d205 Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Mon, 28 Aug 2017 13:34:40 +0300 Subject: [PATCH 02/60] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ac03397..e1f4bbd 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,8 @@ composer require queue-interop/queue-interop * [enqueue/amqp-bunny](https://github.com/php-enqueue/amqp-bunny) * [enqueue/pheanstalk](https://github.com/php-enqueue/pheanstalk) * [enqueue/stomp](https://github.com/php-enqueue/stomp) -* [enqueue/sqs](https://github.com/php-enqueue/sqs) +* Amazon SQS [enqueue/sqs](https://github.com/php-enqueue/sqs) +* Google PubSub [enqueue/gps](https://github.com/php-enqueue/gps) * [enqueue/rdkafka](https://github.com/php-enqueue/rdkafka) * [enqueue/redis](https://github.com/php-enqueue/redis) * [enqueue/gearman](https://github.com/php-enqueue/gearman) From 12c808d02209fdbf4cba6e0fe17f4fbc2220cea2 Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Fri, 8 Sep 2017 10:07:18 +0300 Subject: [PATCH 03/60] Add bernard to the list of projects. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e1f4bbd..6fee696 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ composer require queue-interop/queue-interop * [Enqueue](https://github.com/php-enqueue/enqueue-dev) * [Swarrot](https://github.com/swarrot/swarrot) +* [Bernard](https://github.com/bernardphp/bernard) ### Implementations From 7ba7a6ceca78f5b970f9588eeaba10a5fc3c40d6 Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Tue, 17 Oct 2017 14:37:11 +0300 Subject: [PATCH 04/60] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6fee696..34b0347 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ composer require queue-interop/queue-interop ## Amqp interop -There is AMQP interop built on top of queue interop. It is completly compatible with queue interop and only adds some AMQP specific features. +There is [AMQP interop](https://packagist.org/packages/queue-interop/amqp-interop) built on top of queue interop. It is completly compatible with queue interop and only adds some AMQP specific features. ### Installation From 231e20c7cfc99dbaf29b5fe7506ff29d7a3fb898 Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Wed, 8 Nov 2017 15:27:17 +0200 Subject: [PATCH 05/60] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 34b0347..e06daa6 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ composer require queue-interop/queue-interop * [Enqueue](https://github.com/php-enqueue/enqueue-dev) * [Swarrot](https://github.com/swarrot/swarrot) * [Bernard](https://github.com/bernardphp/bernard) +* [vladimir-yuldashev/laravel-queue-rabbitmq](https://packagist.org/packages/vladimir-yuldashev/laravel-queue-rabbitmq) ### Implementations From 54115f3a38146d9bdd3f40eeb797bafac18cc09c Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Thu, 16 Nov 2017 18:21:23 +0200 Subject: [PATCH 06/60] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e06daa6..04c39f9 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ composer require queue-interop/queue-interop * [Swarrot](https://github.com/swarrot/swarrot) * [Bernard](https://github.com/bernardphp/bernard) * [vladimir-yuldashev/laravel-queue-rabbitmq](https://packagist.org/packages/vladimir-yuldashev/laravel-queue-rabbitmq) +* [sonata-project/notification-bundle](https://github.com/sonata-project/SonataNotificationBundle) ### Implementations From 0d0cf7034ffb76afed54972f2378b62778a9a5cd Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Fri, 17 Nov 2017 12:40:33 +0200 Subject: [PATCH 07/60] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 04c39f9..39b7073 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # Queue Interoperability [![Latest Stable Version](https://poser.pugx.org/queue-interop/queue-interop/v/stable.png)](https://packagist.org/packages/queue-interop/queue-interop) -[![Total Downloads](https://poser.pugx.org/queue-interop/queue-interop/downloads.svg)](https://packagist.org/packages/queue-interop/queue-interop) +[![Monthly Downloads](https://poser.pugx.org/queue-interop/queue-interop/d/monthly)](https://packagist.org/packages/queue-interop/queue-interop) +[![License](https://poser.pugx.org/queue-interop/queue-interop/license)](https://packagist.org/packages/queue-interop/queue-interop) ## About From 5a7d9ab623aa753c6be15c8f404055cb4720ecec Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Tue, 5 Dec 2017 10:55:17 +0200 Subject: [PATCH 08/60] Add yii2-queue to the list of projects --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 39b7073..07ffdee 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ composer require queue-interop/queue-interop * [Bernard](https://github.com/bernardphp/bernard) * [vladimir-yuldashev/laravel-queue-rabbitmq](https://packagist.org/packages/vladimir-yuldashev/laravel-queue-rabbitmq) * [sonata-project/notification-bundle](https://github.com/sonata-project/SonataNotificationBundle) +* [yiisoft/yii2-queue](https://github.com/yiisoft/yii2-queue) ### Implementations From 357513fe787d6810ac4d5a806b9f372d37729723 Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Mon, 15 Jan 2018 21:30:02 +0200 Subject: [PATCH 09/60] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 07ffdee..6e518d4 100644 --- a/README.md +++ b/README.md @@ -66,9 +66,9 @@ composer require queue-interop/amqp-interop ### Compatible projects -* [enqueue/amqp-ext](https://github.com/php-enqueue/amqp-ext) -* [enqueue/amqp-lib](https://github.com/php-enqueue/amqp-lib) -* [enqueue/amqp-bunny](https://github.com/php-enqueue/amqp-bunny) +* [enqueue/amqp-ext](https://github.com/php-enqueue/enqueue-dev/blob/master/docs/transport/amqp.md) +* [enqueue/amqp-lib](https://github.com/php-enqueue/enqueue-dev/blob/master/docs/transport/amqp_lib.md) +* [enqueue/amqp-bunny](https://github.com/php-enqueue/enqueue-dev/blob/master/docs/transport/amqp_bunny.md) ## Workflow From 814990913db0e52ea64d98cd0884a2dfa6305186 Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Mon, 12 Feb 2018 11:05:46 +0200 Subject: [PATCH 10/60] Upd docs. --- README.md | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 6e518d4..ca6e01b 100644 --- a/README.md +++ b/README.md @@ -39,21 +39,27 @@ composer require queue-interop/queue-interop ### Implementations -* [enqueue/amqp-ext](https://github.com/php-enqueue/amqp-ext) -* [enqueue/amqp-lib](https://github.com/php-enqueue/amqp-lib) -* [enqueue/amqp-bunny](https://github.com/php-enqueue/amqp-bunny) -* [enqueue/pheanstalk](https://github.com/php-enqueue/pheanstalk) -* [enqueue/stomp](https://github.com/php-enqueue/stomp) -* Amazon SQS [enqueue/sqs](https://github.com/php-enqueue/sqs) -* Google PubSub [enqueue/gps](https://github.com/php-enqueue/gps) -* [enqueue/rdkafka](https://github.com/php-enqueue/rdkafka) -* [enqueue/redis](https://github.com/php-enqueue/redis) -* [enqueue/gearman](https://github.com/php-enqueue/gearman) -* [enqueue/dbal](https://github.com/php-enqueue/dbal) -* [enqueue/fs](https://github.com/php-enqueue/fs) -* [enqueue/null](https://github.com/php-enqueue/null). +* [enqueue/amqp-ext](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/amqp) +* [enqueue/amqp-lib](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/amqp_lib) +* [enqueue/amqp-bunny](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/amqp_bunny) +* [enqueue/pheanstalk](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/pheanstalk) +* [enqueue/stomp](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/stomp) +* Amazon SQS [enqueue/sqs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/sqs) +* Google PubSub [enqueue/gps](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/gps) +* [enqueue/rdkafka](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/kafka) +* [enqueue/redis](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/redis) +* [enqueue/gearman](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/gearman) +* [enqueue/dbal](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/dbal) +* [enqueue/fs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/fs) +* [enqueue/null](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/null). * [zogwarg/enqueue-elasticsearch](https://github.com/zogwarg/enqueue-elasticsearch) +### Examples + +* [Enqueue transport docs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/) contains a lot how to use example. +* [Formapro's Blog](blog.forma-pro.com) contains varitety blog post about Queue Interop useage. +* [RabbitMQ's official tutorial adopted by AMQP Iterop](https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/php-interop). + ## Amqp interop There is [AMQP interop](https://packagist.org/packages/queue-interop/amqp-interop) built on top of queue interop. It is completly compatible with queue interop and only adds some AMQP specific features. From 4f694837cfca90c8991ee29614ee7a03205dcf22 Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Mon, 12 Feb 2018 11:06:35 +0200 Subject: [PATCH 11/60] add .md --- README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index ca6e01b..35dda05 100644 --- a/README.md +++ b/README.md @@ -39,24 +39,24 @@ composer require queue-interop/queue-interop ### Implementations -* [enqueue/amqp-ext](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/amqp) -* [enqueue/amqp-lib](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/amqp_lib) -* [enqueue/amqp-bunny](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/amqp_bunny) -* [enqueue/pheanstalk](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/pheanstalk) -* [enqueue/stomp](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/stomp) -* Amazon SQS [enqueue/sqs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/sqs) -* Google PubSub [enqueue/gps](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/gps) -* [enqueue/rdkafka](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/kafka) -* [enqueue/redis](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/redis) -* [enqueue/gearman](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/gearman) -* [enqueue/dbal](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/dbal) -* [enqueue/fs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/fs) -* [enqueue/null](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/null). -* [zogwarg/enqueue-elasticsearch](https://github.com/zogwarg/enqueue-elasticsearch) +* [enqueue/amqp-ext](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/amqp.md) +* [enqueue/amqp-lib](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/amqp_lib.md) +* [enqueue/amqp-bunny](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/amqp_bunny.md) +* [enqueue/pheanstalk](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/pheanstalk.md) +* [enqueue/stomp](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/stomp.md) +* Amazon SQS [enqueue/sqs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/sqs.md) +* Google PubSub [enqueue/gps](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/gps.md) +* [enqueue/rdkafka](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/kafka.md) +* [enqueue/redis](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/redis.md) +* [enqueue/gearman](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/gearman.md) +* [enqueue/dbal](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/dbal.md) +* [enqueue/fs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/fs.md) +* [enqueue/null](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/null.md) +* [zogwarg/enqueue-elasticsearch](https://github.com/zogwarg/enqueue-elasticsearch.md) ### Examples -* [Enqueue transport docs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/) contains a lot how to use example. +* [Enqueue transport docs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport) contains a lot how to use example. * [Formapro's Blog](blog.forma-pro.com) contains varitety blog post about Queue Interop useage. * [RabbitMQ's official tutorial adopted by AMQP Iterop](https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/php-interop). From 6cb3022fb829d6997bb747841625448a5a3af5b2 Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Mon, 12 Feb 2018 11:08:46 +0200 Subject: [PATCH 12/60] total downloads badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 35dda05..f666a06 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Latest Stable Version](https://poser.pugx.org/queue-interop/queue-interop/v/stable.png)](https://packagist.org/packages/queue-interop/queue-interop) [![Monthly Downloads](https://poser.pugx.org/queue-interop/queue-interop/d/monthly)](https://packagist.org/packages/queue-interop/queue-interop) +[![Total Downloads](https://poser.pugx.org/queue-interop/queue-interop/d/total.png)](https://packagist.org/packages/queue-interop/queue-interop) [![License](https://poser.pugx.org/queue-interop/queue-interop/license)](https://packagist.org/packages/queue-interop/queue-interop) ## About From f476c216eb4d5ddc377b64130654a270a5b0472e Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Mon, 12 Feb 2018 11:13:48 +0200 Subject: [PATCH 13/60] fix typos. --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f666a06..c444f2c 100644 --- a/README.md +++ b/README.md @@ -51,14 +51,13 @@ composer require queue-interop/queue-interop * [enqueue/redis](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/redis.md) * [enqueue/gearman](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/gearman.md) * [enqueue/dbal](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/dbal.md) -* [enqueue/fs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/fs.md) +* [enqueue/fs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/filesystem.md) * [enqueue/null](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/null.md) -* [zogwarg/enqueue-elasticsearch](https://github.com/zogwarg/enqueue-elasticsearch.md) ### Examples * [Enqueue transport docs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport) contains a lot how to use example. -* [Formapro's Blog](blog.forma-pro.com) contains varitety blog post about Queue Interop useage. +* [Formapro's Blog](https://blog.forma-pro.com) contains varitety blog post about Queue Interop useage. * [RabbitMQ's official tutorial adopted by AMQP Iterop](https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/php-interop). ## Amqp interop From 81f8d5b354d74e4030b4eb11870d618daf2738a0 Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Mon, 12 Feb 2018 11:14:55 +0200 Subject: [PATCH 14/60] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c444f2c..0b6e177 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ composer require queue-interop/queue-interop * [Enqueue transport docs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport) contains a lot how to use example. * [Formapro's Blog](https://blog.forma-pro.com) contains varitety blog post about Queue Interop useage. -* [RabbitMQ's official tutorial adopted by AMQP Iterop](https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/php-interop). +* [RabbitMQ's official tutorials](https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/php-interop) ported to AMQP Interop. ## Amqp interop From 3895cd52d75297cea2a2d45c622912b119cb5f82 Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Mon, 12 Feb 2018 11:20:15 +0200 Subject: [PATCH 15/60] Update README.md --- README.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0b6e177..8fc7ec1 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,53 @@ You can install this package through Composer: composer require queue-interop/queue-interop ``` +## Examples + +Send a message: + +```php +createContext(); +$queue = $context->createQueue(); +$message = $context->createMessage('aBody'); + +$context->createProducer()->send($queue, $message); +``` + +Consume a message: + +```php +createContext(); +$queue = $context->createQueue(); +$consumer = $consumer->createConsumer($queue); + +if ($message = $consumer->receiveNoWait()) { + $consumer->acknowledge($message); +} + +// or + +$timeout = 5000; // 5sec +if ($message = $consumer->receive($timeout)) { + $consumer->acknowledge($message); +} +``` + +Find out more here: + +* [Enqueue transport docs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport) contains a lot how to use example. +* [Formapro's Blog](https://blog.forma-pro.com) contains varitety blog post about Queue Interop useage. +* [RabbitMQ's official tutorials](https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/php-interop) ported to AMQP Interop. + + + ## Compatible projects ### Projects @@ -54,12 +101,6 @@ composer require queue-interop/queue-interop * [enqueue/fs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/filesystem.md) * [enqueue/null](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/null.md) -### Examples - -* [Enqueue transport docs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport) contains a lot how to use example. -* [Formapro's Blog](https://blog.forma-pro.com) contains varitety blog post about Queue Interop useage. -* [RabbitMQ's official tutorials](https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/php-interop) ported to AMQP Interop. - ## Amqp interop There is [AMQP interop](https://packagist.org/packages/queue-interop/amqp-interop) built on top of queue interop. It is completly compatible with queue interop and only adds some AMQP specific features. From 3be8dee3145de66517fbb113b9e6e70eeace8b10 Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Mon, 12 Feb 2018 13:24:46 +0200 Subject: [PATCH 16/60] Update README.md --- README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8fc7ec1..ba27d4d 100644 --- a/README.md +++ b/README.md @@ -37,10 +37,11 @@ Send a message: $factory = new AcmeConnectionFactory('acme://'); $context = $factory->createContext(); -$queue = $context->createQueue(); -$message = $context->createMessage('aBody'); -$context->createProducer()->send($queue, $message); +$context->createProducer()->send( + $context->createQueue('aQueue'), + $context->createMessage('aBody') +); ``` Consume a message: @@ -51,11 +52,13 @@ Consume a message: $factory = new AcmeConnectionFactory('acme://'); $context = $factory->createContext(); -$queue = $context->createQueue(); -$consumer = $consumer->createConsumer($queue); +$consumer = $consumer->createConsumer($context->createQueue('aQueue)); if ($message = $consumer->receiveNoWait()) { $consumer->acknowledge($message); + + // reject on fail + // $consumer->reject($message); } // or From 5f9ab9849793abee2b7726d8267801fc3ed85df2 Mon Sep 17 00:00:00 2001 From: Joubert RedRat Date: Wed, 21 Feb 2018 16:51:41 -0300 Subject: [PATCH 17/60] Fix missing quotation on documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ba27d4d..5633838 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ Consume a message: $factory = new AcmeConnectionFactory('acme://'); $context = $factory->createContext(); -$consumer = $consumer->createConsumer($context->createQueue('aQueue)); +$consumer = $consumer->createConsumer($context->createQueue('aQueue')); if ($message = $consumer->receiveNoWait()) { $consumer->acknowledge($message); From 1ee03fb9adf39afbb51754686b22779d214ea57d Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Thu, 1 Mar 2018 10:00:00 +0200 Subject: [PATCH 18/60] add roadmap. --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 5633838..f715dfc 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,15 @@ Find out more here: * [Formapro's Blog](https://blog.forma-pro.com) contains varitety blog post about Queue Interop useage. * [RabbitMQ's official tutorials](https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/php-interop) ported to AMQP Interop. +## Roadmap + +The Queue Interop project started in the summer of 2016, almost two years ago. Since then It has been well-tried by many developers. A lot of companies use it in production. + +It is time to settle a date of a stable release and possibly some intermediate steps towards it: + +* The 1.0 will be released in December 2018. +* The 1.0-beta1 will be released in August 2018. +* The 1.0-alpha1 will be released in March 2018. ## Compatible projects From 8c2c443596b4c7b25e60bcfb80fc2118000314d3 Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Thu, 1 Mar 2018 10:05:57 +0200 Subject: [PATCH 19/60] upd doc. --- README.md | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index f715dfc..476f144 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,8 @@ this project will pave the way for one or more future PSRs. You can install this package through Composer: ```bash -composer require queue-interop/queue-interop +# Install a Queue Interop compatible transport, for example +$ composer require enqueue/fs ``` ## Examples @@ -34,9 +35,9 @@ Send a message: ```php createContext(); +$context = (new FsConnectionFactory())->createContext(); $context->createProducer()->send( $context->createQueue('aQueue'), @@ -49,22 +50,16 @@ Consume a message: ```php createContext(); -$consumer = $consumer->createConsumer($context->createQueue('aQueue')); - -if ($message = $consumer->receiveNoWait()) { - $consumer->acknowledge($message); - - // reject on fail - // $consumer->reject($message); -} +$context = (new FsConnectionFactory())->createContext(); -// or +$consumer = $consumer->createConsumer($context->createQueue('aQueue')); $timeout = 5000; // 5sec if ($message = $consumer->receive($timeout)) { + // process the message. + $consumer->acknowledge($message); } ``` @@ -115,13 +110,12 @@ It is time to settle a date of a stable release and possibly some intermediate s ## Amqp interop -There is [AMQP interop](https://packagist.org/packages/queue-interop/amqp-interop) built on top of queue interop. It is completly compatible with queue interop and only adds some AMQP specific features. - -### Installation +There is [AMQP interop](https://packagist.org/packages/queue-interop/amqp-interop) built on top of Queue Interop. It is completly compatible with queue interop and only adds some AMQP specific features: -```bash -composer require queue-interop/amqp-interop -``` +* Queue\Exchange declaration +* Queue\Exchange Binding. +* Basic consume support. +* and other AMQP specific features. ### Compatible projects From 92a6d9a12faa327f8c7bfebb88b1e860e39b5683 Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Thu, 15 Mar 2018 09:43:46 +0200 Subject: [PATCH 20/60] Update README.md --- README.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 476f144..780d6c4 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,16 @@ implementations. This facilitates a high-level of interoperability and flexibili The work done in this project is not officially endorsed by the [PHP-FIG](http://www.php-fig.org/). We adhere to the spirit and ideals of PHP-FIG, and hope this project will pave the way for one or more future PSRs. +## Roadmap + +The Queue Interop project started in the summer of 2016, almost two years ago. Since then It has been well-tried by many developers. A lot of companies use it in production. + +It is time to settle a date of a stable release and possibly some intermediate steps towards it: + +* The 1.0 will be released in December 2018. +* The 1.0-beta1 will be released in August 2018. +* The 1.0-alpha1 will be released in March 2018. + ## Installation You can install this package through Composer: @@ -70,17 +80,6 @@ Find out more here: * [Formapro's Blog](https://blog.forma-pro.com) contains varitety blog post about Queue Interop useage. * [RabbitMQ's official tutorials](https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/php-interop) ported to AMQP Interop. -## Roadmap - -The Queue Interop project started in the summer of 2016, almost two years ago. Since then It has been well-tried by many developers. A lot of companies use it in production. - -It is time to settle a date of a stable release and possibly some intermediate steps towards it: - -* The 1.0 will be released in December 2018. -* The 1.0-beta1 will be released in August 2018. -* The 1.0-alpha1 will be released in March 2018. - - ## Compatible projects ### Projects From 7fa3949ef22cd975b0ee7f1bbeaaaa98bd34db84 Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Thu, 15 Mar 2018 09:44:20 +0200 Subject: [PATCH 21/60] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 780d6c4..e3a2435 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ It is time to settle a date of a stable release and possibly some intermediate s * The 1.0 will be released in December 2018. * The 1.0-beta1 will be released in August 2018. -* The 1.0-alpha1 will be released in March 2018. +* The [1.0-alpha1](https://github.com/queue-interop/queue-interop/releases/tag/1.0.0-alpha1) will be released in March 2018. ## Installation From 0ae5189604ad159f88c88358b762898d8455678b Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Tue, 27 Mar 2018 15:55:01 +0300 Subject: [PATCH 22/60] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ed58ae0..45ad4cf 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ }, "extra": { "branch-alias": { - "dev-master": "0.6.x-dev" + "dev-master": "1.0-dev" } } } From dc2a9f0ea7fc87489fb005f88439e5e3530a89a0 Mon Sep 17 00:00:00 2001 From: Aistis Date: Fri, 30 Mar 2018 09:23:45 +0300 Subject: [PATCH 23/60] Fix typo --- src/PsrProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PsrProcessor.php b/src/PsrProcessor.php index 170a869..68bb9b6 100644 --- a/src/PsrProcessor.php +++ b/src/PsrProcessor.php @@ -17,7 +17,7 @@ interface PsrProcessor /** * Use this constant when the message is not valid or could not be processed right now but we can try again later - * The original message is removed from the queue but a copy is publsihed to the queue again. + * The original message is removed from the queue but a copy is published to the queue again. */ const REQUEUE = 'enqueue.requeue'; From 7a90734ff00f2a73d4d4ef3de26d2f955ae4fc53 Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Thu, 5 Apr 2018 09:57:33 +0300 Subject: [PATCH 24/60] Add parameter and return type hints. --- composer.json | 4 +-- src/DeliveryDelayNotSupportedException.php | 3 +- src/Exception.php | 1 + src/ExceptionInterface.php | 3 +- src/InvalidDestinationException.php | 3 +- src/InvalidMessageException.php | 3 +- src/PriorityNotSupportedException.php | 3 +- src/PsrConnectionFactory.php | 3 +- src/PsrConsumer.php | 11 +++--- src/PsrContext.php | 15 ++++---- src/PsrDestination.php | 1 + src/PsrMessage.php | 41 +++++++++++----------- src/PsrProcessor.php | 1 + src/PsrProducer.php | 17 ++++----- src/PsrQueue.php | 3 +- src/PsrTopic.php | 3 +- src/TimeToLiveNotSupportedException.php | 3 +- 17 files changed, 67 insertions(+), 51 deletions(-) diff --git a/composer.json b/composer.json index 45ad4cf..d25e563 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "homepage": "https://github.com/queue-interop/queue-interop", "license": "MIT", "require": { - "php": ">=5.5" + "php": "^7.1.3" }, "autoload": { "psr-4": { @@ -15,7 +15,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "0.7-dev" } } } diff --git a/src/DeliveryDelayNotSupportedException.php b/src/DeliveryDelayNotSupportedException.php index 0267e69..1da937c 100644 --- a/src/DeliveryDelayNotSupportedException.php +++ b/src/DeliveryDelayNotSupportedException.php @@ -1,4 +1,5 @@ value, ...] */ - public function getProperties(); + public function getProperties(): array; /** * @param string $name * @param mixed $value */ - public function setProperty($name, $value); + public function setProperty(string $name, $value): void; /** * @param string $name @@ -47,23 +48,23 @@ public function setProperty($name, $value); * * @return mixed */ - public function getProperty($name, $default = null); + public function getProperty(string $name, $default = null); /** * @param array $headers */ - public function setHeaders(array $headers); + public function setHeaders(array $headers): void; /** * @return array [name => value, ...] */ - public function getHeaders(); + public function getHeaders(): array; /** * @param string $name * @param mixed $value */ - public function setHeader($name, $value); + public function setHeader(string $name, $value): void; /** * @param string $name @@ -71,12 +72,12 @@ public function setHeader($name, $value); * * @return mixed */ - public function getHeader($name, $default = null); + public function getHeader(string $name, $default = null); /** * @param bool $redelivered */ - public function setRedelivered($redelivered); + public function setRedelivered(bool $redelivered): void; /** * Gets an indication of whether this message is being redelivered. @@ -86,7 +87,7 @@ public function setRedelivered($redelivered); * * @return bool */ - public function isRedelivered(); + public function isRedelivered(): bool; /** * Sets the correlation ID for the message. @@ -97,7 +98,7 @@ public function isRedelivered(); * * @throws Exception if the provider fails to set the correlation ID due to some internal error */ - public function setCorrelationId($correlationId); + public function setCorrelationId(string $correlationId = null): void; /** * Gets the correlation ID for the message. @@ -108,7 +109,7 @@ public function setCorrelationId($correlationId); * * @return string */ - public function getCorrelationId(); + public function getCorrelationId(): ?string; /** * Sets the message ID. @@ -119,7 +120,7 @@ public function getCorrelationId(); * * @throws Exception if the provider fails to set the message ID due to some internal error */ - public function setMessageId($messageId); + public function setMessageId(string $messageId = null): void; /** * Gets the message Id. @@ -131,7 +132,7 @@ public function setMessageId($messageId); * * @return string */ - public function getMessageId(); + public function getMessageId(): ?string; /** * Gets the message timestamp. @@ -141,7 +142,7 @@ public function getMessageId(); * * @return int */ - public function getTimestamp(); + public function getTimestamp(): ?int; /** * Sets the message timestamp. @@ -152,7 +153,7 @@ public function getTimestamp(); * * @throws Exception if the provider fails to set the timestamp due to some internal error */ - public function setTimestamp($timestamp); + public function setTimestamp(int $timestamp = null): void; /** * Sets the destination to which a reply to this message should be sent. @@ -167,12 +168,12 @@ public function setTimestamp($timestamp); * * @param string|null $replyTo */ - public function setReplyTo($replyTo); + public function setReplyTo(string $replyTo = null): void; /** * Gets the destination to which a reply to this message should be sent. * * @return string|null */ - public function getReplyTo(); + public function getReplyTo(): ?string; } diff --git a/src/PsrProcessor.php b/src/PsrProcessor.php index 68bb9b6..5ff3f3a 100644 --- a/src/PsrProcessor.php +++ b/src/PsrProcessor.php @@ -1,4 +1,5 @@ Date: Sun, 5 Aug 2018 15:14:43 +0300 Subject: [PATCH 25/60] Add subscription consumer interface --- src/PsrSubscriptionConsumer.php | 40 +++++++++++++++++++++ src/PsrSubscriptionConsumerAwareContext.php | 10 ++++++ 2 files changed, 50 insertions(+) create mode 100644 src/PsrSubscriptionConsumer.php create mode 100644 src/PsrSubscriptionConsumerAwareContext.php diff --git a/src/PsrSubscriptionConsumer.php b/src/PsrSubscriptionConsumer.php new file mode 100644 index 0000000..07c741e --- /dev/null +++ b/src/PsrSubscriptionConsumer.php @@ -0,0 +1,40 @@ + Date: Thu, 16 Aug 2018 09:57:05 +0300 Subject: [PATCH 26/60] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e3a2435..9a704b1 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ Find out more here: * Google PubSub [enqueue/gps](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/gps.md) * [enqueue/rdkafka](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/kafka.md) * [enqueue/redis](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/redis.md) +* [enqueue/mongodb](https://github.com/php-enqueue/enqueue-dev/blob/master/docs/transport/mongodb.md) * [enqueue/gearman](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/gearman.md) * [enqueue/dbal](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/dbal.md) * [enqueue/fs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/filesystem.md) From af8d5d794214c4bdaa62ce25f7ab157ca0849b7d Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Thu, 16 Aug 2018 17:09:27 +0300 Subject: [PATCH 27/60] add subscription consumer to context. --- src/PsrContext.php | 7 +++++++ src/PsrSubscriptionConsumerAwareContext.php | 10 ---------- ...bscriptionConsumerNotSupportedException.php | 18 ++++++++++++++++++ 3 files changed, 25 insertions(+), 10 deletions(-) delete mode 100644 src/PsrSubscriptionConsumerAwareContext.php create mode 100644 src/SubscriptionConsumerNotSupportedException.php diff --git a/src/PsrContext.php b/src/PsrContext.php index 3370761..4712c83 100644 --- a/src/PsrContext.php +++ b/src/PsrContext.php @@ -49,5 +49,12 @@ public function createProducer(): PsrProducer; */ public function createConsumer(PsrDestination $destination): PsrConsumer; + /** + * @throws SubscriptionConsumerNotSupportedException + * + * @return PsrSubscriptionConsumer + */ + public function createSubscriptionConsumer(): PsrSubscriptionConsumer; + public function close(): void; } diff --git a/src/PsrSubscriptionConsumerAwareContext.php b/src/PsrSubscriptionConsumerAwareContext.php deleted file mode 100644 index 971e9f9..0000000 --- a/src/PsrSubscriptionConsumerAwareContext.php +++ /dev/null @@ -1,10 +0,0 @@ - Date: Thu, 16 Aug 2018 17:09:38 +0300 Subject: [PATCH 28/60] add purge queue. --- src/PsrContext.php | 7 +++++++ src/PurgeQueueNotSupportedException.php | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 src/PurgeQueueNotSupportedException.php diff --git a/src/PsrContext.php b/src/PsrContext.php index 4712c83..48175f3 100644 --- a/src/PsrContext.php +++ b/src/PsrContext.php @@ -56,5 +56,12 @@ public function createConsumer(PsrDestination $destination): PsrConsumer; */ public function createSubscriptionConsumer(): PsrSubscriptionConsumer; + /** + * @param PsrQueue $queue + * + * @throws PurgeQueueNotSupportedException + */ + public function purgeQueue(PsrQueue $queue): void; + public function close(): void; } diff --git a/src/PurgeQueueNotSupportedException.php b/src/PurgeQueueNotSupportedException.php new file mode 100644 index 0000000..d87831d --- /dev/null +++ b/src/PurgeQueueNotSupportedException.php @@ -0,0 +1,18 @@ + Date: Wed, 22 Aug 2018 14:27:08 +0300 Subject: [PATCH 29/60] Remove useless docblocks --- src/PsrConnectionFactory.php | 3 -- src/PsrConsumer.php | 13 +------ src/PsrContext.php | 31 +-------------- src/PsrMessage.php | 68 ++------------------------------- src/PsrProducer.php | 21 +++------- src/PsrQueue.php | 2 - src/PsrSubscriptionConsumer.php | 26 +++---------- src/PsrTopic.php | 2 - 8 files changed, 16 insertions(+), 150 deletions(-) diff --git a/src/PsrConnectionFactory.php b/src/PsrConnectionFactory.php index eda4262..4b7f2cb 100644 --- a/src/PsrConnectionFactory.php +++ b/src/PsrConnectionFactory.php @@ -5,8 +5,5 @@ interface PsrConnectionFactory { - /** - * @return PsrContext - */ public function createContext(): PsrContext; } diff --git a/src/PsrConsumer.php b/src/PsrConsumer.php index 7b9e019..7848a37 100644 --- a/src/PsrConsumer.php +++ b/src/PsrConsumer.php @@ -14,8 +14,6 @@ interface PsrConsumer { /** * Gets the Queue associated with this queue receiver. - * - * @return PsrQueue */ public function getQueue(): PsrQueue; @@ -24,31 +22,22 @@ public function getQueue(): PsrQueue; * This call blocks until a message arrives, the timeout expires, or this message consumer is closed. * A timeout of zero never expires, and the call blocks indefinitely. * - * @param int $timeout the timeout value (in milliseconds) - * - * @return PsrMessage|null + * Timeout is in milliseconds */ public function receive(int $timeout = 0): ?PsrMessage; /** * Receives the next message if one is immediately available. - * - * @return PsrMessage|null */ public function receiveNoWait(): ?PsrMessage; /** * Tell the MQ broker that the message was processed successfully. - * - * @param PsrMessage $message */ public function acknowledge(PsrMessage $message): void; /** * Tell the MQ broker that the message was rejected. - * - * @param PsrMessage $message - * @param bool $requeue */ public function reject(PsrMessage $message, bool $requeue = false): void; } diff --git a/src/PsrContext.php b/src/PsrContext.php index 48175f3..979680d 100644 --- a/src/PsrContext.php +++ b/src/PsrContext.php @@ -5,27 +5,10 @@ interface PsrContext { - /** - * @param string $body - * @param array $properties - * @param array $headers - * - * @return PsrMessage - */ public function createMessage(string $body = '', array $properties = [], array $headers = []): PsrMessage; - /** - * @param string $topicName - * - * @return PsrTopic - */ public function createTopic(string $topicName): PsrTopic; - /** - * @param string $queueName - * - * @return PsrQueue - */ public function createQueue(string $queueName): PsrQueue; /** @@ -33,32 +16,20 @@ public function createQueue(string $queueName): PsrQueue; * The queue is visible by this connection only. * It will be deleted once the connection is closed. * - * @return PsrQueue + * @throws TemporaryQueueNotSupportedException */ public function createTemporaryQueue(): PsrQueue; - /** - * @return PsrProducer - */ public function createProducer(): PsrProducer; - /** - * @param PsrDestination $destination - * - * @return PsrConsumer - */ public function createConsumer(PsrDestination $destination): PsrConsumer; /** * @throws SubscriptionConsumerNotSupportedException - * - * @return PsrSubscriptionConsumer */ public function createSubscriptionConsumer(): PsrSubscriptionConsumer; /** - * @param PsrQueue $queue - * * @throws PurgeQueueNotSupportedException */ public function purgeQueue(PsrQueue $queue): void; diff --git a/src/PsrMessage.php b/src/PsrMessage.php index ca86cd4..838c3c4 100644 --- a/src/PsrMessage.php +++ b/src/PsrMessage.php @@ -16,67 +16,32 @@ */ interface PsrMessage { - /** - * @return string - */ public function getBody(): string; - /** - * @param string $body - */ public function setBody(string $body): void; - /** - * @param array $properties - */ public function setProperties(array $properties): void; /** - * @return array [name => value, ...] + * Returns [name => value, ...] */ public function getProperties(): array; - /** - * @param string $name - * @param mixed $value - */ public function setProperty(string $name, $value): void; - /** - * @param string $name - * @param mixed $default - * - * @return mixed - */ public function getProperty(string $name, $default = null); - /** - * @param array $headers - */ public function setHeaders(array $headers): void; /** - * @return array [name => value, ...] + * Returns [name => value, ...] */ public function getHeaders(): array; - /** - * @param string $name - * @param mixed $value - */ public function setHeader(string $name, $value): void; - /** - * @param string $name - * @param mixed $default - * - * @return mixed - */ public function getHeader(string $name, $default = null); - /** - * @param bool $redelivered - */ public function setRedelivered(bool $redelivered): void; /** @@ -84,8 +49,6 @@ public function setRedelivered(bool $redelivered): void; * The message is considered as redelivered, * when it was sent by a broker to consumer but consumer does not ACK or REJECT it. * The broker brings the message back to the queue and mark it as redelivered. - * - * @return bool */ public function isRedelivered(): bool; @@ -93,10 +56,6 @@ public function isRedelivered(): bool; * Sets the correlation ID for the message. * A client can use the correlation header field to link one message with another. * A typical use is to link a response message with its request message. - * - * @param string $correlationId the message ID of a message being referred to - * - * @throws Exception if the provider fails to set the correlation ID due to some internal error */ public function setCorrelationId(string $correlationId = null): void; @@ -104,10 +63,6 @@ public function setCorrelationId(string $correlationId = null): void; * Gets the correlation ID for the message. * This method is used to return correlation ID values that are either provider-specific message IDs * or application-specific String values. - * - * @throws Exception if the provider fails to get the correlation ID due to some internal error - * - * @return string */ public function getCorrelationId(): ?string; @@ -115,10 +70,6 @@ public function getCorrelationId(): ?string; * Sets the message ID. * Providers set this field when a message is sent. * This method can be used to change the value for a message that has been received. - * - * @param string $messageId the ID of the message - * - * @throws Exception if the provider fails to set the message ID due to some internal error */ public function setMessageId(string $messageId = null): void; @@ -127,10 +78,6 @@ public function setMessageId(string $messageId = null): void; * The MessageId header field contains a value that uniquely identifies each message sent by a provider. * * When a message is sent, MessageId can be ignored. - * - * @throws Exception if the provider fails to get the message ID due to some internal error - * - * @return string */ public function getMessageId(): ?string; @@ -139,8 +86,6 @@ public function getMessageId(): ?string; * The timestamp header field contains the time a message was handed off to a provider to be sent. * It is not the time the message was actually transmitted, * because the actual send may occur later due to transactions or other client-side queueing of messages. - * - * @return int */ public function getTimestamp(): ?int; @@ -148,10 +93,6 @@ public function getTimestamp(): ?int; * Sets the message timestamp. * Providers set this field when a message is sent. * This method can be used to change the value for a message that has been received. - * - * @param int $timestamp - * - * @throws Exception if the provider fails to set the timestamp due to some internal error */ public function setTimestamp(int $timestamp = null): void; @@ -165,15 +106,12 @@ public function setTimestamp(int $timestamp = null): void; * A message sent in response to a request is called a reply. * In some cases a client may wish to match a request it sent earlier with a reply it has just received. * The client can use the CorrelationID header field for this purpose. - * - * @param string|null $replyTo + */ public function setReplyTo(string $replyTo = null): void; /** * Gets the destination to which a reply to this message should be sent. - * - * @return string|null */ public function getReplyTo(): ?string; } diff --git a/src/PsrProducer.php b/src/PsrProducer.php index 480f582..95d5a3d 100644 --- a/src/PsrProducer.php +++ b/src/PsrProducer.php @@ -6,9 +6,6 @@ interface PsrProducer { /** - * @param PsrDestination $destination - * @param PsrMessage $message - * * @throws Exception if the provider fails to send the message due to some internal error * @throws InvalidDestinationException if a client uses this method with an invalid destination * @throws InvalidMessageException if an invalid message is specified @@ -19,18 +16,16 @@ public function send(PsrDestination $destination, PsrMessage $message): void; * Sets the minimum length of time in milliseconds that must elapse after a message is sent before the provider may deliver the message to a consumer. * deliveryDelay is set to null default. * - * @param int|null $deliveryDelay - the delivery delay in milliseconds. Use null to unset delivery delay and use transport's mode + * The delivery delay is in milliseconds. Use null to unset delivery delay and use transport's mode * * @throws DeliveryDelayNotSupportedException if producer does not support delivery delay feature - * - * @return self */ public function setDeliveryDelay(int $deliveryDelay = null): self; /** * Gets the minimum length of time in milliseconds that must elapse after a message is sent before the provider may deliver the message to a consumer. * - * @return int|float|null the delivery delay in milliseconds. + * @return int|null the delivery delay in milliseconds. */ public function getDeliveryDelay(): ?int; @@ -40,18 +35,14 @@ public function getDeliveryDelay(): ?int; * Clients should consider priorities 0-4 as gradations of normal priority and priorities 5-9 as gradations of expedited priority. * Priority is set to null by default. * - * @param int|null $priority Use null to unset priority and use transport's mode + * Use null to unset priority and use transport's mode * * @throws PriorityNotSupportedException if producer does not support priority feature - * - * @return self */ public function setPriority(int $priority = null): self; /** * Return the priority of messages that are sent using this Producer - * - * @return int|null the message priority */ public function getPriority(): ?int; @@ -64,18 +55,16 @@ public function getPriority(): ?int; * It is not acceptable to simply ignore time-to-live. * timeToLive is set to null default. * - * @param int|float|null $timeToLive the message time to live to be used, in milliseconds; a value of zero means that a message never expires. Use null to unset time to live and use transport's mode + * The message time to live to be used, in milliseconds; a value of zero means that a message never expires. Use null to unset time to live and use transport's mode * * @throws TimeToLiveNotSupportedException if producer does not support time to live feature - * - * @return self */ public function setTimeToLive(int $timeToLive = null): self; /** * Returns the time to live of messages that are sent using this JMSProducer. * - * @return int|float|null the message time to live in milliseconds; a value of zero means that a message never expires. + * @return int|null the message time to live in milliseconds; a value of zero means that a message never expires. */ public function getTimeToLive(): ?int; } diff --git a/src/PsrQueue.php b/src/PsrQueue.php index d536aed..0c0537c 100644 --- a/src/PsrQueue.php +++ b/src/PsrQueue.php @@ -14,8 +14,6 @@ interface PsrQueue extends PsrDestination { /** * Gets the name of this queue. This is a destination one consumes messages from. - * - * @return string */ public function getQueueName(): string; } diff --git a/src/PsrSubscriptionConsumer.php b/src/PsrSubscriptionConsumer.php index 07c741e..f0c8fa1 100644 --- a/src/PsrSubscriptionConsumer.php +++ b/src/PsrSubscriptionConsumer.php @@ -4,9 +4,10 @@ interface PsrSubscriptionConsumer { /** - * @param float|int $timeout Milliseconds 1000 is 1 second, a zero is consume endlessly. + * The timeout is in milliseconds. + * Set zero to consume endlessly or till a consumer returns false. */ - public function consume($timeout = 0); + public function consume(int $timeout = 0): void; /** * Notify broker that the client is interested in consuming messages from this queue. @@ -16,25 +17,10 @@ public function consume($timeout = 0); * and an optional second parameter the \Interop\Queue\PsrConsumer from which the message was * consumed. The consumer will not return the processing thread back to * the PHP script until the callback function returns FALSE. - * - * @param PsrConsumer $consumer - * @param callable $callback - * - * @return void */ - public function subscribe(PsrConsumer $consumer, callable $callback); + public function subscribe(PsrConsumer $consumer, callable $callback): void; - /** - * @param PsrConsumer $consumer - * - * @return void - */ - public function unsubscribe(PsrConsumer $consumer); + public function unsubscribe(PsrConsumer $consumer): void; - /** - * Unsubscribe all subscribed consumers. - * - * @return void - */ - public function unsubscribeAll(); + public function unsubscribeAll(): void; } diff --git a/src/PsrTopic.php b/src/PsrTopic.php index 1f57409..200ca92 100644 --- a/src/PsrTopic.php +++ b/src/PsrTopic.php @@ -14,8 +14,6 @@ interface PsrTopic extends PsrDestination { /** * Gets the name of this topic. This is a destination one sends messages to. - * - * @return string */ public function getTopicName(): string; } From dd577d7ce3174b49ea56a90463d00933f0eb37e0 Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Wed, 22 Aug 2018 14:27:19 +0300 Subject: [PATCH 30/60] add temporary queue not supported exception. --- src/TemporaryQueueNotSupportedException.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/TemporaryQueueNotSupportedException.php diff --git a/src/TemporaryQueueNotSupportedException.php b/src/TemporaryQueueNotSupportedException.php new file mode 100644 index 0000000..ee00e26 --- /dev/null +++ b/src/TemporaryQueueNotSupportedException.php @@ -0,0 +1,18 @@ + Date: Thu, 23 Aug 2018 21:06:08 +0300 Subject: [PATCH 31/60] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a704b1..ed2ad76 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Queue Interoperability +# PHP7.1+ Queue Interoperability [![Latest Stable Version](https://poser.pugx.org/queue-interop/queue-interop/v/stable.png)](https://packagist.org/packages/queue-interop/queue-interop) [![Monthly Downloads](https://poser.pugx.org/queue-interop/queue-interop/d/monthly)](https://packagist.org/packages/queue-interop/queue-interop) From ca05d2df461418cd0e07c2acc575bdfd2500e4f5 Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Thu, 27 Sep 2018 16:46:00 +0300 Subject: [PATCH 32/60] Get rid of Psr prefix. Move exceptions to subfolder. --- src/ConnectionFactory.php | 12 ++++++++++++ src/Consumer.php | 12 ++++++++++++ src/Context.php | 12 ++++++++++++ src/DeliveryDelayNotSupportedException.php | 3 +++ src/Destination.php | 12 ++++++++++++ src/Exception.php | 4 ++++ src/Exception/DeliveryDelayNotSupportedException.php | 12 ++++++++++++ src/Exception/Exception.php | 12 ++++++++++++ src/Exception/InvalidDestinationException.php | 12 ++++++++++++ src/Exception/InvalidMessageException.php | 12 ++++++++++++ src/Exception/PriorityNotSupportedException.php | 12 ++++++++++++ src/Exception/PurgeQueueNotSupportedException.php | 12 ++++++++++++ .../SubscriptionConsumerNotSupportedException.php | 12 ++++++++++++ .../TemporaryQueueNotSupportedException.php | 12 ++++++++++++ src/Exception/TimeToLiveNotSupportedException.php | 12 ++++++++++++ src/InvalidDestinationException.php | 6 ++++++ src/InvalidMessageException.php | 6 ++++++ src/Message.php | 12 ++++++++++++ src/PriorityNotSupportedException.php | 6 ++++++ src/Processor.php | 12 ++++++++++++ src/PsrConnectionFactory.php | 6 ++++++ src/PsrConsumer.php | 6 ++++++ src/PsrContext.php | 12 ++++++++++++ src/PsrDestination.php | 4 ++++ src/PsrMessage.php | 4 ++++ src/PsrProcessor.php | 7 +++++++ src/PsrProducer.php | 7 +++++++ src/PsrQueue.php | 5 +++++ src/PsrSubscriptionConsumer.php | 9 +++++++++ src/PsrTopic.php | 5 +++++ src/PurgeQueueNotSupportedException.php | 6 ++++++ src/Queue.php | 12 ++++++++++++ src/SubscriptionConsumer.php | 12 ++++++++++++ src/SubscriptionConsumerNotSupportedException.php | 6 ++++++ src/TemporaryQueueNotSupportedException.php | 6 ++++++ src/TimeToLiveNotSupportedException.php | 6 ++++++ src/Topic.php | 12 ++++++++++++ 37 files changed, 330 insertions(+) create mode 100644 src/ConnectionFactory.php create mode 100644 src/Consumer.php create mode 100644 src/Context.php create mode 100644 src/Destination.php create mode 100644 src/Exception/DeliveryDelayNotSupportedException.php create mode 100644 src/Exception/Exception.php create mode 100644 src/Exception/InvalidDestinationException.php create mode 100644 src/Exception/InvalidMessageException.php create mode 100644 src/Exception/PriorityNotSupportedException.php create mode 100644 src/Exception/PurgeQueueNotSupportedException.php create mode 100644 src/Exception/SubscriptionConsumerNotSupportedException.php create mode 100644 src/Exception/TemporaryQueueNotSupportedException.php create mode 100644 src/Exception/TimeToLiveNotSupportedException.php create mode 100644 src/Message.php create mode 100644 src/Processor.php create mode 100644 src/Queue.php create mode 100644 src/SubscriptionConsumer.php create mode 100644 src/Topic.php diff --git a/src/ConnectionFactory.php b/src/ConnectionFactory.php new file mode 100644 index 0000000..d4f48f9 --- /dev/null +++ b/src/ConnectionFactory.php @@ -0,0 +1,12 @@ + Date: Fri, 28 Sep 2018 10:44:45 +0300 Subject: [PATCH 33/60] add missing class alias. --- src/DeliveryDelayNotSupportedException.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/DeliveryDelayNotSupportedException.php b/src/DeliveryDelayNotSupportedException.php index f4ad1cb..1ab48cd 100644 --- a/src/DeliveryDelayNotSupportedException.php +++ b/src/DeliveryDelayNotSupportedException.php @@ -19,3 +19,5 @@ public static function providerDoestNotSupportIt(int $code = 0, \Throwable $prev return new static('The provider does not support delivery delay feature', $code, $previous); } } + +class_alias('Interop\Queue\DeliveryDelayNotSupportedException', 'Interop\Queue\Exception\DeliveryDelayNotSupportedException', false); \ No newline at end of file From f1bc37233b8cfcf6f20f05ebd49204840c3357bc Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Fri, 28 Sep 2018 11:00:36 +0300 Subject: [PATCH 34/60] add Producer. --- src/Producer.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/Producer.php diff --git a/src/Producer.php b/src/Producer.php new file mode 100644 index 0000000..74fe9c3 --- /dev/null +++ b/src/Producer.php @@ -0,0 +1,12 @@ + Date: Mon, 8 Oct 2018 19:14:07 +0300 Subject: [PATCH 35/60] Revert "Update README.md" This reverts commit 7723249d30f446c2344ca7688366eec1ef955e53. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ed2ad76..9a704b1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# PHP7.1+ Queue Interoperability +# Queue Interoperability [![Latest Stable Version](https://poser.pugx.org/queue-interop/queue-interop/v/stable.png)](https://packagist.org/packages/queue-interop/queue-interop) [![Monthly Downloads](https://poser.pugx.org/queue-interop/queue-interop/d/monthly)](https://packagist.org/packages/queue-interop/queue-interop) From 9c944419952f4a587bf0dcf7a8a977d08ea5535f Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Mon, 8 Oct 2018 19:29:48 +0300 Subject: [PATCH 36/60] properly remove deprecated stuff --- src/ConnectionFactory.php | 9 +- src/Consumer.php | 41 +++++- src/Context.php | 40 +++++- src/DeliveryDelayNotSupportedException.php | 23 ---- src/Destination.php | 20 ++- src/Exception.php | 11 +- .../DeliveryDelayNotSupportedException.php | 14 +- src/Exception/Exception.php | 8 +- src/Exception/InvalidDestinationException.php | 20 ++- src/Exception/InvalidMessageException.php | 20 ++- .../PriorityNotSupportedException.php | 14 +- .../PurgeQueueNotSupportedException.php | 14 +- ...scriptionConsumerNotSupportedException.php | 14 +- .../TemporaryQueueNotSupportedException.php | 14 +- .../TimeToLiveNotSupportedException.php | 14 +- src/ExceptionInterface.php | 8 -- src/InvalidDestinationException.php | 30 ----- src/InvalidMessageException.php | 30 ----- src/Message.php | 115 ++++++++++++++++- src/PriorityNotSupportedException.php | 24 ---- src/Processor.php | 35 ++++- src/Producer.php | 74 ++++++++++- src/PsrConnectionFactory.php | 15 --- src/PsrConsumer.php | 49 ------- src/PsrContext.php | 50 -------- src/PsrDestination.php | 24 ---- src/PsrMessage.php | 121 ------------------ src/PsrProcessor.php | 44 ------- src/PsrProducer.php | 77 ----------- src/PsrQueue.php | 24 ---- src/PsrSubscriptionConsumer.php | 35 ----- src/PsrTopic.php | 24 ---- src/PurgeQueueNotSupportedException.php | 24 ---- src/Queue.php | 12 +- src/SubscriptionConsumer.php | 26 +++- ...scriptionConsumerNotSupportedException.php | 24 ---- src/TemporaryQueueNotSupportedException.php | 24 ---- src/TimeToLiveNotSupportedException.php | 24 ---- src/Topic.php | 19 ++- 39 files changed, 433 insertions(+), 775 deletions(-) delete mode 100644 src/DeliveryDelayNotSupportedException.php delete mode 100644 src/ExceptionInterface.php delete mode 100644 src/InvalidDestinationException.php delete mode 100644 src/InvalidMessageException.php delete mode 100644 src/PriorityNotSupportedException.php delete mode 100644 src/PsrConnectionFactory.php delete mode 100644 src/PsrConsumer.php delete mode 100644 src/PsrContext.php delete mode 100644 src/PsrDestination.php delete mode 100644 src/PsrMessage.php delete mode 100644 src/PsrProcessor.php delete mode 100644 src/PsrProducer.php delete mode 100644 src/PsrQueue.php delete mode 100644 src/PsrSubscriptionConsumer.php delete mode 100644 src/PsrTopic.php delete mode 100644 src/PurgeQueueNotSupportedException.php delete mode 100644 src/SubscriptionConsumerNotSupportedException.php delete mode 100644 src/TemporaryQueueNotSupportedException.php delete mode 100644 src/TimeToLiveNotSupportedException.php diff --git a/src/ConnectionFactory.php b/src/ConnectionFactory.php index d4f48f9..093b169 100644 --- a/src/ConnectionFactory.php +++ b/src/ConnectionFactory.php @@ -3,10 +3,7 @@ namespace Interop\Queue; -class_exists('Interop\Queue\PsrConnectionFactory'); - -if (\false) { - interface ConnectionFactory extends PsrConnectionFactory - { - } +interface ConnectionFactory +{ + public function createContext(): Context; } \ No newline at end of file diff --git a/src/Consumer.php b/src/Consumer.php index 391d67b..a7bf144 100644 --- a/src/Consumer.php +++ b/src/Consumer.php @@ -3,10 +3,41 @@ namespace Interop\Queue; -class_exists('Interop\Queue\PsrConsumer'); +/** + * A client uses a MessageConsumer object to receive messages from a destination. + * A MessageConsumer object is created by passing a Destination object + * to a message-consumer creation method supplied by a session. + * + * @see https://docs.oracle.com/javaee/7/api/javax/jms/MessageConsumer.html + */ +interface Consumer +{ + /** + * Gets the Queue associated with this queue receiver. + */ + public function getQueue(): Queue; -if (\false) { - interface Consumer extends PsrConsumer - { - } + /** + * Receives the next message that arrives within the specified timeout interval. + * This call blocks until a message arrives, the timeout expires, or this message consumer is closed. + * A timeout of zero never expires, and the call blocks indefinitely. + * + * Timeout is in milliseconds + */ + public function receive(int $timeout = 0): ?Message; + + /** + * Receives the next message if one is immediately available. + */ + public function receiveNoWait(): ?Message; + + /** + * Tell the MQ broker that the message was processed successfully. + */ + public function acknowledge(Message $message): void; + + /** + * Tell the MQ broker that the message was rejected. + */ + public function reject(Message $message, bool $requeue = false): void; } \ No newline at end of file diff --git a/src/Context.php b/src/Context.php index ac90336..6d341b4 100644 --- a/src/Context.php +++ b/src/Context.php @@ -3,10 +3,40 @@ namespace Interop\Queue; -class_exists('Interop\Queue\PsrContext'); +use Interop\Queue\Exception\PurgeQueueNotSupportedException; +use Interop\Queue\Exception\SubscriptionConsumerNotSupportedException; +use Interop\Queue\Exception\TemporaryQueueNotSupportedException; -if (\false) { - interface Context extends PsrContext - { - } +interface Context +{ + public function createMessage(string $body = '', array $properties = [], array $headers = []): Message; + + public function createTopic(string $topicName): Topic; + + public function createQueue(string $queueName): Queue; + + /** + * Create temporary queue. + * The queue is visible by this connection only. + * It will be deleted once the connection is closed. + * + * @throws TemporaryQueueNotSupportedException + */ + public function createTemporaryQueue(): Queue; + + public function createProducer(): Producer; + + public function createConsumer(Destination $destination): Consumer; + + /** + * @throws SubscriptionConsumerNotSupportedException + */ + public function createSubscriptionConsumer(): SubscriptionConsumer; + + /** + * @throws PurgeQueueNotSupportedException + */ + public function purgeQueue(Queue $queue): void; + + public function close(): void; } \ No newline at end of file diff --git a/src/DeliveryDelayNotSupportedException.php b/src/DeliveryDelayNotSupportedException.php deleted file mode 100644 index 1ab48cd..0000000 --- a/src/DeliveryDelayNotSupportedException.php +++ /dev/null @@ -1,23 +0,0 @@ - value, ...] + */ + public function getProperties(): array; + + public function setProperty(string $name, $value): void; + + public function getProperty(string $name, $default = null); + + public function setHeaders(array $headers): void; + + /** + * Returns [name => value, ...] + */ + public function getHeaders(): array; + + public function setHeader(string $name, $value): void; + + public function getHeader(string $name, $default = null); + + public function setRedelivered(bool $redelivered): void; + + /** + * Gets an indication of whether this message is being redelivered. + * The message is considered as redelivered, + * when it was sent by a broker to consumer but consumer does not ACK or REJECT it. + * The broker brings the message back to the queue and mark it as redelivered. + */ + public function isRedelivered(): bool; + + /** + * Sets the correlation ID for the message. + * A client can use the correlation header field to link one message with another. + * A typical use is to link a response message with its request message. + */ + public function setCorrelationId(string $correlationId = null): void; + + /** + * Gets the correlation ID for the message. + * This method is used to return correlation ID values that are either provider-specific message IDs + * or application-specific String values. + */ + public function getCorrelationId(): ?string; + + /** + * Sets the message ID. + * Providers set this field when a message is sent. + * This method can be used to change the value for a message that has been received. + */ + public function setMessageId(string $messageId = null): void; + + /** + * Gets the message Id. + * The MessageId header field contains a value that uniquely identifies each message sent by a provider. + * + * When a message is sent, MessageId can be ignored. + */ + public function getMessageId(): ?string; + + /** + * Gets the message timestamp. + * The timestamp header field contains the time a message was handed off to a provider to be sent. + * It is not the time the message was actually transmitted, + * because the actual send may occur later due to transactions or other client-side queueing of messages. + */ + public function getTimestamp(): ?int; + + /** + * Sets the message timestamp. + * Providers set this field when a message is sent. + * This method can be used to change the value for a message that has been received. + */ + public function setTimestamp(int $timestamp = null): void; + + /** + * Sets the destination to which a reply to this message should be sent. + * The ReplyTo header field contains the destination where a reply to the current message should be sent. If it is null, no reply is expected. + * The destination may be a Queue only. A topic is not supported at the moment. + * Messages sent with a null ReplyTo value may be a notification of some event, or they may just be some data the sender thinks is of interest. + * Messages with a ReplyTo value typically expect a response. + * A response is optional; it is up to the client to decide. These messages are called requests. + * A message sent in response to a request is called a reply. + * In some cases a client may wish to match a request it sent earlier with a reply it has just received. + * The client can use the CorrelationID header field for this purpose. + + */ + public function setReplyTo(string $replyTo = null): void; + + /** + * Gets the destination to which a reply to this message should be sent. + */ + public function getReplyTo(): ?string; } \ No newline at end of file diff --git a/src/PriorityNotSupportedException.php b/src/PriorityNotSupportedException.php deleted file mode 100644 index ded970c..0000000 --- a/src/PriorityNotSupportedException.php +++ /dev/null @@ -1,24 +0,0 @@ - value, ...] - */ - public function getProperties(): array; - - public function setProperty(string $name, $value): void; - - public function getProperty(string $name, $default = null); - - public function setHeaders(array $headers): void; - - /** - * Returns [name => value, ...] - */ - public function getHeaders(): array; - - public function setHeader(string $name, $value): void; - - public function getHeader(string $name, $default = null); - - public function setRedelivered(bool $redelivered): void; - - /** - * Gets an indication of whether this message is being redelivered. - * The message is considered as redelivered, - * when it was sent by a broker to consumer but consumer does not ACK or REJECT it. - * The broker brings the message back to the queue and mark it as redelivered. - */ - public function isRedelivered(): bool; - - /** - * Sets the correlation ID for the message. - * A client can use the correlation header field to link one message with another. - * A typical use is to link a response message with its request message. - */ - public function setCorrelationId(string $correlationId = null): void; - - /** - * Gets the correlation ID for the message. - * This method is used to return correlation ID values that are either provider-specific message IDs - * or application-specific String values. - */ - public function getCorrelationId(): ?string; - - /** - * Sets the message ID. - * Providers set this field when a message is sent. - * This method can be used to change the value for a message that has been received. - */ - public function setMessageId(string $messageId = null): void; - - /** - * Gets the message Id. - * The MessageId header field contains a value that uniquely identifies each message sent by a provider. - * - * When a message is sent, MessageId can be ignored. - */ - public function getMessageId(): ?string; - - /** - * Gets the message timestamp. - * The timestamp header field contains the time a message was handed off to a provider to be sent. - * It is not the time the message was actually transmitted, - * because the actual send may occur later due to transactions or other client-side queueing of messages. - */ - public function getTimestamp(): ?int; - - /** - * Sets the message timestamp. - * Providers set this field when a message is sent. - * This method can be used to change the value for a message that has been received. - */ - public function setTimestamp(int $timestamp = null): void; - - /** - * Sets the destination to which a reply to this message should be sent. - * The ReplyTo header field contains the destination where a reply to the current message should be sent. If it is null, no reply is expected. - * The destination may be a Queue only. A topic is not supported at the moment. - * Messages sent with a null ReplyTo value may be a notification of some event, or they may just be some data the sender thinks is of interest. - * Messages with a ReplyTo value typically expect a response. - * A response is optional; it is up to the client to decide. These messages are called requests. - * A message sent in response to a request is called a reply. - * In some cases a client may wish to match a request it sent earlier with a reply it has just received. - * The client can use the CorrelationID header field for this purpose. - - */ - public function setReplyTo(string $replyTo = null): void; - - /** - * Gets the destination to which a reply to this message should be sent. - */ - public function getReplyTo(): ?string; -} - -class_alias('Interop\Queue\PsrMessage', 'Interop\Queue\Message', false); diff --git a/src/PsrProcessor.php b/src/PsrProcessor.php deleted file mode 100644 index 3f5b329..0000000 --- a/src/PsrProcessor.php +++ /dev/null @@ -1,44 +0,0 @@ - Date: Sat, 13 Oct 2018 03:22:10 +0200 Subject: [PATCH 37/60] Message interface implementation --- src/MessageTrait.php | 157 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 src/MessageTrait.php diff --git a/src/MessageTrait.php b/src/MessageTrait.php new file mode 100644 index 0000000..fe91546 --- /dev/null +++ b/src/MessageTrait.php @@ -0,0 +1,157 @@ +id = $id; + } + + public function getId(): ?string + { + return $this->id; + } + + public function getBody(): string + { + return $this->body; + } + + public function setBody(string $body): void + { + $this->body = $body; + } + + public function setProperties(array $properties): void + { + $this->properties = $properties; + } + + public function setProperty(string $name, $value): void + { + if(null === $value) { + unset($this->properties[$name]); + } else { + $this->properties[$name] = $value; + } + } + + public function getProperties(): array + { + return $this->properties; + } + + public function getProperty(string $name, $default = null) + { + return array_key_exists($name, $this->properties) ? $this->properties[$name] : $default; + } + + public function setHeader(string $name, $value): void + { + if(null === $value) { + unset($this->headers[$name]); + } else { + $this->headers[$name] = $value; + } + } + + public function setHeaders(array $headers): void + { + $this->headers = $headers; + } + + public function getHeaders(): array + { + return $this->headers; + } + + public function getHeader(string $name, $default = null) + { + return array_key_exists($name, $this->headers) ? $this->headers[$name] : $default; + } + + public function setRedelivered(bool $redelivered): void + { + $this->redelivered = $redelivered; + } + + public function isRedelivered(): bool + { + return $this->redelivered; + } + + public function setCorrelationId(string $correlationId = null): void + { + $this->setHeader('correlation_id', $correlationId); + } + + public function getCorrelationId(): ?string + { + return $this->getHeader('correlation_id'); + } + + public function setMessageId(string $messageId = null): void + { + $this->setHeader('message_id', $messageId); + } + + public function getMessageId(): ?string + { + return $this->getHeader('message_id'); + } + + public function getTimestamp(): ?int + { + $value = $this->getHeader('timestamp'); + + return null === $value ? null : (int) $value; + } + + public function setTimestamp(int $timestamp = null): void + { + $this->setHeader('timestamp', $timestamp); + } + + public function setReplyTo(string $replyTo = null): void + { + $this->setHeader('reply_to', $replyTo); + } + + public function getReplyTo(): ?string + { + return $this->getHeader('reply_to'); + } +} \ No newline at end of file From 0e9cda46960975939596c656719b72002b6c8566 Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Mon, 15 Oct 2018 17:52:20 +0300 Subject: [PATCH 38/60] Add PHP-FPM transport. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9a704b1..74d1206 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,7 @@ Find out more here: * [enqueue/dbal](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/dbal.md) * [enqueue/fs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/filesystem.md) * [enqueue/null](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/null.md) +* [makasim/php-fpm-queue](https://github.com/makasim/php-fpm-queue) ## Amqp interop From ff2e6934017da28b9709e8651b9231947fdb44e8 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Sat, 13 Oct 2018 03:22:10 +0200 Subject: [PATCH 39/60] Message interface implementation --- .gitignore | 1 + Tests/MessageTraitTest.php | 30 + composer.json | 3 + composer.lock | 1407 ++++++++++++++++++++++++++++++++++ src/MessageTrait.php | 18 +- src/Test/MessageTestCase.php | 126 +++ 6 files changed, 1568 insertions(+), 17 deletions(-) create mode 100644 .gitignore create mode 100644 Tests/MessageTraitTest.php create mode 100644 composer.lock create mode 100644 src/Test/MessageTestCase.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ed70c79 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/vendor/* diff --git a/Tests/MessageTraitTest.php b/Tests/MessageTraitTest.php new file mode 100644 index 0000000..ff6a163 --- /dev/null +++ b/Tests/MessageTraitTest.php @@ -0,0 +1,30 @@ +body = $body; + $this->properties = $properties; + $this->headers = $headers; + + $this->redelivered = false; + } +} diff --git a/composer.json b/composer.json index d25e563..be33566 100644 --- a/composer.json +++ b/composer.json @@ -8,6 +8,9 @@ "require": { "php": "^7.1.3" }, + "require-dev": { + "phpunit/phpunit": "^5.5" + }, "autoload": { "psr-4": { "Interop\\Queue\\": "src/" diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..73e2d7d --- /dev/null +++ b/composer.lock @@ -0,0 +1,1407 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "e7cca4333477ebb7016e80ba84700131", + "packages": [], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2017-07-22T11:58:36+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.8.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2018-06-11T23:09:50+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-30T07:14:17+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2018-08-05T17:53:17+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" + }, + "require-dev": { + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" + }, + "suggest": { + "ext-xdebug": "^2.5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2017-04-02T07:44:40+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2017-11-27T13:52:08+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "791198a2c6254db10131eecfe8c06670700904db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-11-27T05:48:46+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "5.7.27", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.4.3", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "^1.0.6|^2.0.1", + "symfony/yaml": "~2.1|~3.0|~4.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.7.x-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": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2018-02-01T05:50:59+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "3.4.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2017-06-30T09:13:00+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "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" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2016-11-26T07:53:53+00:00" + }, + { + "name": "sebastian/exporter", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "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" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2016-11-19T08:54:04+00:00" + }, + { + "name": "sebastian/global-state", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2015-10-12T03:26:01+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-02-18T15:18:39+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2016-11-19T07:33:16+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-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": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.9.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/yaml", + "version": "v4.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "367e689b2fdc19965be435337b50bc8adf2746c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/367e689b2fdc19965be435337b50bc8adf2746c9", + "reference": "367e689b2fdc19965be435337b50bc8adf2746c9", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T16:36:10+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-01-29T19:49:41+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "^7.1.3" + }, + "platform-dev": [] +} diff --git a/src/MessageTrait.php b/src/MessageTrait.php index fe91546..cf465d8 100644 --- a/src/MessageTrait.php +++ b/src/MessageTrait.php @@ -1,5 +1,4 @@ id = $id; - } - - public function getId(): ?string - { - return $this->id; - } - public function getBody(): string { return $this->body; @@ -154,4 +138,4 @@ public function getReplyTo(): ?string { return $this->getHeader('reply_to'); } -} \ No newline at end of file +} diff --git a/src/Test/MessageTestCase.php b/src/Test/MessageTestCase.php new file mode 100644 index 0000000..384edf5 --- /dev/null +++ b/src/Test/MessageTestCase.php @@ -0,0 +1,126 @@ +getMessage(); + + $this->assertSame('', $message->getBody()); + $this->assertSame([], $message->getProperties()); + $this->assertSame([], $message->getHeaders()); + $this->assertSame(false, $message->isRedelivered()); + } + + public function testCouldBeConstructedWithOptionalArguments() + { + $message = $this->getMessage('theBody', ['barProp' => 'barPropVal'], ['fooHeader' => 'fooHeaderVal']); + + $this->assertSame('theBody', $message->getBody()); + $this->assertSame(['barProp' => 'barPropVal'], $message->getProperties()); + $this->assertSame(['fooHeader' => 'fooHeaderVal'], $message->getHeaders()); + $this->assertSame(false, $message->isRedelivered()); + } + + public function testShouldSetBody() + { + $message = $this->getMessage(); + $message->setBody('the-body'); + + $this->assertSame('the-body', $message->getBody()); + } + + public function testShouldSetProperties() + { + $message = $this->getMessage(); + $message->setProperty('the-other-property', 'the-other-value'); + $message->setProperties(['the-property' => 'the-value']); + + $this->assertSame(['the-property' => 'the-value'], $message->getProperties()); + $this->assertSame('the-value', $message->getProperty('the-property')); + $this->assertSame(null, $message->getProperty('the-other-property')); + } + + public function testShouldSetAndUnsetProperty() + { + $message = $this->getMessage(); + $message->setProperty('the-property', 'the-value'); + + $this->assertSame(['the-property' => 'the-value'], $message->getProperties()); + $this->assertSame('the-value', $message->getProperty('the-property')); + $this->assertSame('the-value', $message->getProperty('the-property', 'the-default')); + + $message->setProperty('the-property', null); + + $this->assertSame([], $message->getProperties()); + $this->assertSame(null, $message->getProperty('the-property')); + $this->assertSame('the-default', $message->getProperty('the-property', 'the-default')); + } + + public function testShouldSetHeaders() + { + $message = $this->getMessage(); + $message->setHeader('the-other-header', 'the-other-value'); + $message->setHeaders(['the-header' => 'the-value']); + + $this->assertSame(['the-header' => 'the-value'], $message->getHeaders()); + $this->assertSame('the-value', $message->getHeader('the-header')); + $this->assertSame(null, $message->getHeader('the-other-header')); + } + + public function testShouldSetAndUnsetHeader() + { + $message = $this->getMessage(); + $message->setHeader('the-header', 'the-value'); + + $this->assertSame(['the-header' => 'the-value'], $message->getHeaders()); + $this->assertSame('the-value', $message->getHeader('the-header')); + $this->assertSame('the-value', $message->getHeader('the-header', 'the-default')); + + $message->setHeader('the-header', null); + + $this->assertSame([], $message->getHeaders()); + $this->assertSame(null, $message->getHeader('the-header')); + $this->assertSame('the-default', $message->getHeader('the-header', 'the-default')); + } + + public function testShouldSetCorrelationIdAsHeader() + { + $message = $this->getMessage(); + $message->setCorrelationId('the-correlation-id'); + + $this->assertSame(['correlation_id' => 'the-correlation-id'], $message->getHeaders()); + } + + public function testCouldSetMessageIdAsHeader() + { + $message = $this->getMessage(); + $message->setMessageId('the-message-id'); + + $this->assertSame(['message_id' => 'the-message-id'], $message->getHeaders()); + } + + public function testCouldSetTimestampAsHeader() + { + $message = $this->getMessage(); + $message->setTimestamp(12345); + + $this->assertSame(['timestamp' => 12345], $message->getHeaders()); + } + + public function testShouldSetReplyToAsHeader() + { + $message = $this->getMessage(); + $message->setReplyTo('theQueueName'); + + $this->assertSame(['reply_to' => 'theQueueName'], $message->getHeaders()); + } +} From 34e2affd5a0ace3149838968ea477901514bd0a1 Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Mon, 15 Oct 2018 23:07:46 +0300 Subject: [PATCH 40/60] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 74d1206..7a4fcfa 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,7 @@ Find out more here: * [enqueue/fs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/filesystem.md) * [enqueue/null](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/null.md) * [makasim/php-fpm-queue](https://github.com/makasim/php-fpm-queue) +* [makasim/rabbitmq-cli-consumer-client](https://github.com/makasim/rabbitmq-cli-consumer-client) ## Amqp interop From 644d4b24cb15d4e5ed2b930f853888ae4134b308 Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Mon, 15 Oct 2018 23:08:15 +0300 Subject: [PATCH 41/60] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a4fcfa..591488a 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ Find out more here: * [enqueue/amqp-ext](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/amqp.md) * [enqueue/amqp-lib](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/amqp_lib.md) * [enqueue/amqp-bunny](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/amqp_bunny.md) +* [makasim/rabbitmq-cli-consumer-client](https://github.com/makasim/rabbitmq-cli-consumer-client) * [enqueue/pheanstalk](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/pheanstalk.md) * [enqueue/stomp](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/stomp.md) * Amazon SQS [enqueue/sqs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/sqs.md) @@ -108,7 +109,6 @@ Find out more here: * [enqueue/fs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/filesystem.md) * [enqueue/null](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/null.md) * [makasim/php-fpm-queue](https://github.com/makasim/php-fpm-queue) -* [makasim/rabbitmq-cli-consumer-client](https://github.com/makasim/rabbitmq-cli-consumer-client) ## Amqp interop @@ -124,6 +124,7 @@ There is [AMQP interop](https://packagist.org/packages/queue-interop/amqp-intero * [enqueue/amqp-ext](https://github.com/php-enqueue/enqueue-dev/blob/master/docs/transport/amqp.md) * [enqueue/amqp-lib](https://github.com/php-enqueue/enqueue-dev/blob/master/docs/transport/amqp_lib.md) * [enqueue/amqp-bunny](https://github.com/php-enqueue/enqueue-dev/blob/master/docs/transport/amqp_bunny.md) +* [makasim/rabbitmq-cli-consumer-client](https://github.com/makasim/rabbitmq-cli-consumer-client) ## Workflow From 580d170cfabfe1ad7b3498d70b8cce82686ae997 Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Thu, 18 Oct 2018 09:13:43 +0300 Subject: [PATCH 42/60] add impl folder, use queue-spec to test it. --- .travis.yml | 21 ++++++ Tests/MessageTraitTest.php | 30 -------- composer.json | 3 +- composer.lock | 40 +++++++++- phpunit.xml.dist | 30 ++++++++ src/{ => Impl}/MessageTrait.php | 2 +- src/Test/MessageTestCase.php | 126 -------------------------------- tests/Spec/MessageTest.php | 26 +++++++ 8 files changed, 118 insertions(+), 160 deletions(-) create mode 100644 .travis.yml delete mode 100644 Tests/MessageTraitTest.php create mode 100644 phpunit.xml.dist rename src/{ => Impl}/MessageTrait.php (98%) delete mode 100644 src/Test/MessageTestCase.php create mode 100644 tests/Spec/MessageTest.php diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..5426e2e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,21 @@ +sudo: false + +git: + depth: 10 + +language: php + +php: + - '7.1' + - '7.2' + +cache: + directories: + - $HOME/.composer/cache + +install: + - composer self-update + - composer install --prefer-source + +script: + - vendor/bin/phpunit \ No newline at end of file diff --git a/Tests/MessageTraitTest.php b/Tests/MessageTraitTest.php deleted file mode 100644 index ff6a163..0000000 --- a/Tests/MessageTraitTest.php +++ /dev/null @@ -1,30 +0,0 @@ -body = $body; - $this->properties = $properties; - $this->headers = $headers; - - $this->redelivered = false; - } -} diff --git a/composer.json b/composer.json index be33566..d8d01e1 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,8 @@ "php": "^7.1.3" }, "require-dev": { - "phpunit/phpunit": "^5.5" + "phpunit/phpunit": "^5.5", + "queue-interop/queue-spec": "0.6.x-dev" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 73e2d7d..f1ac575 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e7cca4333477ebb7016e80ba84700131", + "content-hash": "7d749e1d9b9326ec9413073deba2c9a3", "packages": [], "packages-dev": [ { @@ -714,6 +714,40 @@ ], "time": "2017-06-30T09:13:00+00:00" }, + { + "name": "queue-interop/queue-spec", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/queue-interop/queue-spec.git", + "reference": "0a8dae210db1362cd27e8ac6ef72914fda609827" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/queue-interop/queue-spec/zipball/0a8dae210db1362cd27e8ac6ef72914fda609827", + "reference": "0a8dae210db1362cd27e8ac6ef72914fda609827", + "shasum": "" + }, + "require": { + "queue-interop/queue-interop": "0.7.x-dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.6.x-dev" + } + }, + "autoload": { + "psr-4": { + "Interop\\Queue\\Spec\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "time": "2018-09-28T12:20:50+00:00" + }, { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.1", @@ -1397,7 +1431,9 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "queue-interop/queue-spec": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..dbb6142 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,30 @@ + + + + + + + ./tests + + + + + + . + + ./vendor + ./tests + + + + diff --git a/src/MessageTrait.php b/src/Impl/MessageTrait.php similarity index 98% rename from src/MessageTrait.php rename to src/Impl/MessageTrait.php index cf465d8..ee014a9 100644 --- a/src/MessageTrait.php +++ b/src/Impl/MessageTrait.php @@ -1,7 +1,7 @@ getMessage(); - - $this->assertSame('', $message->getBody()); - $this->assertSame([], $message->getProperties()); - $this->assertSame([], $message->getHeaders()); - $this->assertSame(false, $message->isRedelivered()); - } - - public function testCouldBeConstructedWithOptionalArguments() - { - $message = $this->getMessage('theBody', ['barProp' => 'barPropVal'], ['fooHeader' => 'fooHeaderVal']); - - $this->assertSame('theBody', $message->getBody()); - $this->assertSame(['barProp' => 'barPropVal'], $message->getProperties()); - $this->assertSame(['fooHeader' => 'fooHeaderVal'], $message->getHeaders()); - $this->assertSame(false, $message->isRedelivered()); - } - - public function testShouldSetBody() - { - $message = $this->getMessage(); - $message->setBody('the-body'); - - $this->assertSame('the-body', $message->getBody()); - } - - public function testShouldSetProperties() - { - $message = $this->getMessage(); - $message->setProperty('the-other-property', 'the-other-value'); - $message->setProperties(['the-property' => 'the-value']); - - $this->assertSame(['the-property' => 'the-value'], $message->getProperties()); - $this->assertSame('the-value', $message->getProperty('the-property')); - $this->assertSame(null, $message->getProperty('the-other-property')); - } - - public function testShouldSetAndUnsetProperty() - { - $message = $this->getMessage(); - $message->setProperty('the-property', 'the-value'); - - $this->assertSame(['the-property' => 'the-value'], $message->getProperties()); - $this->assertSame('the-value', $message->getProperty('the-property')); - $this->assertSame('the-value', $message->getProperty('the-property', 'the-default')); - - $message->setProperty('the-property', null); - - $this->assertSame([], $message->getProperties()); - $this->assertSame(null, $message->getProperty('the-property')); - $this->assertSame('the-default', $message->getProperty('the-property', 'the-default')); - } - - public function testShouldSetHeaders() - { - $message = $this->getMessage(); - $message->setHeader('the-other-header', 'the-other-value'); - $message->setHeaders(['the-header' => 'the-value']); - - $this->assertSame(['the-header' => 'the-value'], $message->getHeaders()); - $this->assertSame('the-value', $message->getHeader('the-header')); - $this->assertSame(null, $message->getHeader('the-other-header')); - } - - public function testShouldSetAndUnsetHeader() - { - $message = $this->getMessage(); - $message->setHeader('the-header', 'the-value'); - - $this->assertSame(['the-header' => 'the-value'], $message->getHeaders()); - $this->assertSame('the-value', $message->getHeader('the-header')); - $this->assertSame('the-value', $message->getHeader('the-header', 'the-default')); - - $message->setHeader('the-header', null); - - $this->assertSame([], $message->getHeaders()); - $this->assertSame(null, $message->getHeader('the-header')); - $this->assertSame('the-default', $message->getHeader('the-header', 'the-default')); - } - - public function testShouldSetCorrelationIdAsHeader() - { - $message = $this->getMessage(); - $message->setCorrelationId('the-correlation-id'); - - $this->assertSame(['correlation_id' => 'the-correlation-id'], $message->getHeaders()); - } - - public function testCouldSetMessageIdAsHeader() - { - $message = $this->getMessage(); - $message->setMessageId('the-message-id'); - - $this->assertSame(['message_id' => 'the-message-id'], $message->getHeaders()); - } - - public function testCouldSetTimestampAsHeader() - { - $message = $this->getMessage(); - $message->setTimestamp(12345); - - $this->assertSame(['timestamp' => 12345], $message->getHeaders()); - } - - public function testShouldSetReplyToAsHeader() - { - $message = $this->getMessage(); - $message->setReplyTo('theQueueName'); - - $this->assertSame(['reply_to' => 'theQueueName'], $message->getHeaders()); - } -} diff --git a/tests/Spec/MessageTest.php b/tests/Spec/MessageTest.php new file mode 100644 index 0000000..3f01be3 --- /dev/null +++ b/tests/Spec/MessageTest.php @@ -0,0 +1,26 @@ +body = $body; + $this->properties = $properties; + $this->headers = $headers; + + $this->redelivered = false; + } + }; + } +} \ No newline at end of file From db0bc47178ef5f64ea5f9a33c681b0ffd17ec53b Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Mon, 15 Oct 2018 22:07:31 +0300 Subject: [PATCH 43/60] Merge pull request #19 from sylfabre/patch-1 Message interface implementation # Conflicts: # src/MessageTrait.php --- .gitignore | 1 + Tests/MessageTraitTest.php | 30 + composer.json | 3 + composer.lock | 1407 ++++++++++++++++++++++++++++++++++ src/MessageTrait.php | 141 ++++ src/Test/MessageTestCase.php | 126 +++ 6 files changed, 1708 insertions(+) create mode 100644 .gitignore create mode 100644 Tests/MessageTraitTest.php create mode 100644 composer.lock create mode 100644 src/MessageTrait.php create mode 100644 src/Test/MessageTestCase.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ed70c79 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/vendor/* diff --git a/Tests/MessageTraitTest.php b/Tests/MessageTraitTest.php new file mode 100644 index 0000000..ff6a163 --- /dev/null +++ b/Tests/MessageTraitTest.php @@ -0,0 +1,30 @@ +body = $body; + $this->properties = $properties; + $this->headers = $headers; + + $this->redelivered = false; + } +} diff --git a/composer.json b/composer.json index d25e563..be33566 100644 --- a/composer.json +++ b/composer.json @@ -8,6 +8,9 @@ "require": { "php": "^7.1.3" }, + "require-dev": { + "phpunit/phpunit": "^5.5" + }, "autoload": { "psr-4": { "Interop\\Queue\\": "src/" diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..73e2d7d --- /dev/null +++ b/composer.lock @@ -0,0 +1,1407 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "e7cca4333477ebb7016e80ba84700131", + "packages": [], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2017-07-22T11:58:36+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.8.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2018-06-11T23:09:50+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-30T07:14:17+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2018-08-05T17:53:17+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" + }, + "require-dev": { + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" + }, + "suggest": { + "ext-xdebug": "^2.5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2017-04-02T07:44:40+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2017-11-27T13:52:08+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "791198a2c6254db10131eecfe8c06670700904db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-11-27T05:48:46+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "5.7.27", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.4.3", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "^1.0.6|^2.0.1", + "symfony/yaml": "~2.1|~3.0|~4.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.7.x-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": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2018-02-01T05:50:59+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "3.4.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2017-06-30T09:13:00+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "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" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2016-11-26T07:53:53+00:00" + }, + { + "name": "sebastian/exporter", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "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" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2016-11-19T08:54:04+00:00" + }, + { + "name": "sebastian/global-state", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2015-10-12T03:26:01+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-02-18T15:18:39+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2016-11-19T07:33:16+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-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": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.9.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/yaml", + "version": "v4.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "367e689b2fdc19965be435337b50bc8adf2746c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/367e689b2fdc19965be435337b50bc8adf2746c9", + "reference": "367e689b2fdc19965be435337b50bc8adf2746c9", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T16:36:10+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-01-29T19:49:41+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "^7.1.3" + }, + "platform-dev": [] +} diff --git a/src/MessageTrait.php b/src/MessageTrait.php new file mode 100644 index 0000000..cf465d8 --- /dev/null +++ b/src/MessageTrait.php @@ -0,0 +1,141 @@ +body; + } + + public function setBody(string $body): void + { + $this->body = $body; + } + + public function setProperties(array $properties): void + { + $this->properties = $properties; + } + + public function setProperty(string $name, $value): void + { + if(null === $value) { + unset($this->properties[$name]); + } else { + $this->properties[$name] = $value; + } + } + + public function getProperties(): array + { + return $this->properties; + } + + public function getProperty(string $name, $default = null) + { + return array_key_exists($name, $this->properties) ? $this->properties[$name] : $default; + } + + public function setHeader(string $name, $value): void + { + if(null === $value) { + unset($this->headers[$name]); + } else { + $this->headers[$name] = $value; + } + } + + public function setHeaders(array $headers): void + { + $this->headers = $headers; + } + + public function getHeaders(): array + { + return $this->headers; + } + + public function getHeader(string $name, $default = null) + { + return array_key_exists($name, $this->headers) ? $this->headers[$name] : $default; + } + + public function setRedelivered(bool $redelivered): void + { + $this->redelivered = $redelivered; + } + + public function isRedelivered(): bool + { + return $this->redelivered; + } + + public function setCorrelationId(string $correlationId = null): void + { + $this->setHeader('correlation_id', $correlationId); + } + + public function getCorrelationId(): ?string + { + return $this->getHeader('correlation_id'); + } + + public function setMessageId(string $messageId = null): void + { + $this->setHeader('message_id', $messageId); + } + + public function getMessageId(): ?string + { + return $this->getHeader('message_id'); + } + + public function getTimestamp(): ?int + { + $value = $this->getHeader('timestamp'); + + return null === $value ? null : (int) $value; + } + + public function setTimestamp(int $timestamp = null): void + { + $this->setHeader('timestamp', $timestamp); + } + + public function setReplyTo(string $replyTo = null): void + { + $this->setHeader('reply_to', $replyTo); + } + + public function getReplyTo(): ?string + { + return $this->getHeader('reply_to'); + } +} diff --git a/src/Test/MessageTestCase.php b/src/Test/MessageTestCase.php new file mode 100644 index 0000000..384edf5 --- /dev/null +++ b/src/Test/MessageTestCase.php @@ -0,0 +1,126 @@ +getMessage(); + + $this->assertSame('', $message->getBody()); + $this->assertSame([], $message->getProperties()); + $this->assertSame([], $message->getHeaders()); + $this->assertSame(false, $message->isRedelivered()); + } + + public function testCouldBeConstructedWithOptionalArguments() + { + $message = $this->getMessage('theBody', ['barProp' => 'barPropVal'], ['fooHeader' => 'fooHeaderVal']); + + $this->assertSame('theBody', $message->getBody()); + $this->assertSame(['barProp' => 'barPropVal'], $message->getProperties()); + $this->assertSame(['fooHeader' => 'fooHeaderVal'], $message->getHeaders()); + $this->assertSame(false, $message->isRedelivered()); + } + + public function testShouldSetBody() + { + $message = $this->getMessage(); + $message->setBody('the-body'); + + $this->assertSame('the-body', $message->getBody()); + } + + public function testShouldSetProperties() + { + $message = $this->getMessage(); + $message->setProperty('the-other-property', 'the-other-value'); + $message->setProperties(['the-property' => 'the-value']); + + $this->assertSame(['the-property' => 'the-value'], $message->getProperties()); + $this->assertSame('the-value', $message->getProperty('the-property')); + $this->assertSame(null, $message->getProperty('the-other-property')); + } + + public function testShouldSetAndUnsetProperty() + { + $message = $this->getMessage(); + $message->setProperty('the-property', 'the-value'); + + $this->assertSame(['the-property' => 'the-value'], $message->getProperties()); + $this->assertSame('the-value', $message->getProperty('the-property')); + $this->assertSame('the-value', $message->getProperty('the-property', 'the-default')); + + $message->setProperty('the-property', null); + + $this->assertSame([], $message->getProperties()); + $this->assertSame(null, $message->getProperty('the-property')); + $this->assertSame('the-default', $message->getProperty('the-property', 'the-default')); + } + + public function testShouldSetHeaders() + { + $message = $this->getMessage(); + $message->setHeader('the-other-header', 'the-other-value'); + $message->setHeaders(['the-header' => 'the-value']); + + $this->assertSame(['the-header' => 'the-value'], $message->getHeaders()); + $this->assertSame('the-value', $message->getHeader('the-header')); + $this->assertSame(null, $message->getHeader('the-other-header')); + } + + public function testShouldSetAndUnsetHeader() + { + $message = $this->getMessage(); + $message->setHeader('the-header', 'the-value'); + + $this->assertSame(['the-header' => 'the-value'], $message->getHeaders()); + $this->assertSame('the-value', $message->getHeader('the-header')); + $this->assertSame('the-value', $message->getHeader('the-header', 'the-default')); + + $message->setHeader('the-header', null); + + $this->assertSame([], $message->getHeaders()); + $this->assertSame(null, $message->getHeader('the-header')); + $this->assertSame('the-default', $message->getHeader('the-header', 'the-default')); + } + + public function testShouldSetCorrelationIdAsHeader() + { + $message = $this->getMessage(); + $message->setCorrelationId('the-correlation-id'); + + $this->assertSame(['correlation_id' => 'the-correlation-id'], $message->getHeaders()); + } + + public function testCouldSetMessageIdAsHeader() + { + $message = $this->getMessage(); + $message->setMessageId('the-message-id'); + + $this->assertSame(['message_id' => 'the-message-id'], $message->getHeaders()); + } + + public function testCouldSetTimestampAsHeader() + { + $message = $this->getMessage(); + $message->setTimestamp(12345); + + $this->assertSame(['timestamp' => 12345], $message->getHeaders()); + } + + public function testShouldSetReplyToAsHeader() + { + $message = $this->getMessage(); + $message->setReplyTo('theQueueName'); + + $this->assertSame(['reply_to' => 'theQueueName'], $message->getHeaders()); + } +} From ad1f885d84262e571cb7166f393081551389ede8 Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Thu, 18 Oct 2018 13:27:24 +0300 Subject: [PATCH 44/60] Merge pull request #20 from queue-interop/impl add impl folder, use queue-spec to test it. --- .travis.yml | 21 ++++++ Tests/MessageTraitTest.php | 30 -------- composer.json | 3 +- composer.lock | 40 +++++++++- phpunit.xml.dist | 30 ++++++++ src/{ => Impl}/MessageTrait.php | 2 +- src/Test/MessageTestCase.php | 126 -------------------------------- tests/Spec/MessageTest.php | 26 +++++++ 8 files changed, 118 insertions(+), 160 deletions(-) create mode 100644 .travis.yml delete mode 100644 Tests/MessageTraitTest.php create mode 100644 phpunit.xml.dist rename src/{ => Impl}/MessageTrait.php (98%) delete mode 100644 src/Test/MessageTestCase.php create mode 100644 tests/Spec/MessageTest.php diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..5426e2e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,21 @@ +sudo: false + +git: + depth: 10 + +language: php + +php: + - '7.1' + - '7.2' + +cache: + directories: + - $HOME/.composer/cache + +install: + - composer self-update + - composer install --prefer-source + +script: + - vendor/bin/phpunit \ No newline at end of file diff --git a/Tests/MessageTraitTest.php b/Tests/MessageTraitTest.php deleted file mode 100644 index ff6a163..0000000 --- a/Tests/MessageTraitTest.php +++ /dev/null @@ -1,30 +0,0 @@ -body = $body; - $this->properties = $properties; - $this->headers = $headers; - - $this->redelivered = false; - } -} diff --git a/composer.json b/composer.json index be33566..d8d01e1 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,8 @@ "php": "^7.1.3" }, "require-dev": { - "phpunit/phpunit": "^5.5" + "phpunit/phpunit": "^5.5", + "queue-interop/queue-spec": "0.6.x-dev" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 73e2d7d..f1ac575 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e7cca4333477ebb7016e80ba84700131", + "content-hash": "7d749e1d9b9326ec9413073deba2c9a3", "packages": [], "packages-dev": [ { @@ -714,6 +714,40 @@ ], "time": "2017-06-30T09:13:00+00:00" }, + { + "name": "queue-interop/queue-spec", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/queue-interop/queue-spec.git", + "reference": "0a8dae210db1362cd27e8ac6ef72914fda609827" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/queue-interop/queue-spec/zipball/0a8dae210db1362cd27e8ac6ef72914fda609827", + "reference": "0a8dae210db1362cd27e8ac6ef72914fda609827", + "shasum": "" + }, + "require": { + "queue-interop/queue-interop": "0.7.x-dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.6.x-dev" + } + }, + "autoload": { + "psr-4": { + "Interop\\Queue\\Spec\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "time": "2018-09-28T12:20:50+00:00" + }, { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.1", @@ -1397,7 +1431,9 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "queue-interop/queue-spec": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..dbb6142 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,30 @@ + + + + + + + ./tests + + + + + + . + + ./vendor + ./tests + + + + diff --git a/src/MessageTrait.php b/src/Impl/MessageTrait.php similarity index 98% rename from src/MessageTrait.php rename to src/Impl/MessageTrait.php index cf465d8..ee014a9 100644 --- a/src/MessageTrait.php +++ b/src/Impl/MessageTrait.php @@ -1,7 +1,7 @@ getMessage(); - - $this->assertSame('', $message->getBody()); - $this->assertSame([], $message->getProperties()); - $this->assertSame([], $message->getHeaders()); - $this->assertSame(false, $message->isRedelivered()); - } - - public function testCouldBeConstructedWithOptionalArguments() - { - $message = $this->getMessage('theBody', ['barProp' => 'barPropVal'], ['fooHeader' => 'fooHeaderVal']); - - $this->assertSame('theBody', $message->getBody()); - $this->assertSame(['barProp' => 'barPropVal'], $message->getProperties()); - $this->assertSame(['fooHeader' => 'fooHeaderVal'], $message->getHeaders()); - $this->assertSame(false, $message->isRedelivered()); - } - - public function testShouldSetBody() - { - $message = $this->getMessage(); - $message->setBody('the-body'); - - $this->assertSame('the-body', $message->getBody()); - } - - public function testShouldSetProperties() - { - $message = $this->getMessage(); - $message->setProperty('the-other-property', 'the-other-value'); - $message->setProperties(['the-property' => 'the-value']); - - $this->assertSame(['the-property' => 'the-value'], $message->getProperties()); - $this->assertSame('the-value', $message->getProperty('the-property')); - $this->assertSame(null, $message->getProperty('the-other-property')); - } - - public function testShouldSetAndUnsetProperty() - { - $message = $this->getMessage(); - $message->setProperty('the-property', 'the-value'); - - $this->assertSame(['the-property' => 'the-value'], $message->getProperties()); - $this->assertSame('the-value', $message->getProperty('the-property')); - $this->assertSame('the-value', $message->getProperty('the-property', 'the-default')); - - $message->setProperty('the-property', null); - - $this->assertSame([], $message->getProperties()); - $this->assertSame(null, $message->getProperty('the-property')); - $this->assertSame('the-default', $message->getProperty('the-property', 'the-default')); - } - - public function testShouldSetHeaders() - { - $message = $this->getMessage(); - $message->setHeader('the-other-header', 'the-other-value'); - $message->setHeaders(['the-header' => 'the-value']); - - $this->assertSame(['the-header' => 'the-value'], $message->getHeaders()); - $this->assertSame('the-value', $message->getHeader('the-header')); - $this->assertSame(null, $message->getHeader('the-other-header')); - } - - public function testShouldSetAndUnsetHeader() - { - $message = $this->getMessage(); - $message->setHeader('the-header', 'the-value'); - - $this->assertSame(['the-header' => 'the-value'], $message->getHeaders()); - $this->assertSame('the-value', $message->getHeader('the-header')); - $this->assertSame('the-value', $message->getHeader('the-header', 'the-default')); - - $message->setHeader('the-header', null); - - $this->assertSame([], $message->getHeaders()); - $this->assertSame(null, $message->getHeader('the-header')); - $this->assertSame('the-default', $message->getHeader('the-header', 'the-default')); - } - - public function testShouldSetCorrelationIdAsHeader() - { - $message = $this->getMessage(); - $message->setCorrelationId('the-correlation-id'); - - $this->assertSame(['correlation_id' => 'the-correlation-id'], $message->getHeaders()); - } - - public function testCouldSetMessageIdAsHeader() - { - $message = $this->getMessage(); - $message->setMessageId('the-message-id'); - - $this->assertSame(['message_id' => 'the-message-id'], $message->getHeaders()); - } - - public function testCouldSetTimestampAsHeader() - { - $message = $this->getMessage(); - $message->setTimestamp(12345); - - $this->assertSame(['timestamp' => 12345], $message->getHeaders()); - } - - public function testShouldSetReplyToAsHeader() - { - $message = $this->getMessage(); - $message->setReplyTo('theQueueName'); - - $this->assertSame(['reply_to' => 'theQueueName'], $message->getHeaders()); - } -} diff --git a/tests/Spec/MessageTest.php b/tests/Spec/MessageTest.php new file mode 100644 index 0000000..3f01be3 --- /dev/null +++ b/tests/Spec/MessageTest.php @@ -0,0 +1,26 @@ +body = $body; + $this->properties = $properties; + $this->headers = $headers; + + $this->redelivered = false; + } + }; + } +} \ No newline at end of file From f98476db10072e3279b5887353d35b5c43d51bb8 Mon Sep 17 00:00:00 2001 From: Sylvain Fabre Date: Thu, 18 Oct 2018 22:18:20 +0200 Subject: [PATCH 45/60] consumer polling trait --- src/Impl/ConsumerPollingTrait.php | 72 ++++++++++++++++++++++++++++++ tests/Spec/ConsumerPollingTest.php | 71 +++++++++++++++++++++++++++++ 2 files changed, 143 insertions(+) create mode 100644 src/Impl/ConsumerPollingTrait.php create mode 100644 tests/Spec/ConsumerPollingTest.php diff --git a/src/Impl/ConsumerPollingTrait.php b/src/Impl/ConsumerPollingTrait.php new file mode 100644 index 0000000..6e0bfb4 --- /dev/null +++ b/src/Impl/ConsumerPollingTrait.php @@ -0,0 +1,72 @@ +pollingInterval = $msec; + } + + /** + * Get polling interval in milliseconds. + */ + public function getPollingInterval(): int + { + return $this->pollingInterval; + } + + public function receive(int $timeout = 0): ?Message + { + $timeout *= 1000; // from milliseconds to microseconds + $startAt = microtime(true); + + while(true) { + $message = $this->receiveNoWait(); + + if($message) { + return $message; + } + + if($timeout) { + + $timeSpent = microtime(true) - $startAt; + $timeSpent *= 1000000; // from seconds to microseconds + $timeLeft = $timeout - $timeSpent; + + // No time left to wait + if($timeLeft <= 0) { + return null; + } + + // We pay attention not to wait too long to go over the timeout limit + $sleep = min($timeLeft, $this->pollingInterval * 1000); + + } else { + $sleep = $this->pollingInterval * 1000; + } + + usleep(intval($sleep)); + } + + return null; + } + + public abstract function receiveNoWait(): ?Message; +} \ No newline at end of file diff --git a/tests/Spec/ConsumerPollingTest.php b/tests/Spec/ConsumerPollingTest.php new file mode 100644 index 0000000..44bd733 --- /dev/null +++ b/tests/Spec/ConsumerPollingTest.php @@ -0,0 +1,71 @@ +callable = $receiveNoWait; + } + + public function receiveNoWait(): ?Message + { + $callable = $this->callable; + return $callable($this->count); + } + }; + } + + public function testShouldTimeout() + { + $consumer = $this->getConsumer(function() { + return null; + }); + + $start = microtime(true); + + $consumer->receive(250); + + $timer = microtime(true) - $start; + + $this->assertGreaterThan(0.250, $timer); + $this->assertLessThan(0.255, $timer); + } + + public function testShouldCallThreeTimes() + { + $message = $this->getMockForAbstractClass(Message::class); + + $consumer = $this->getConsumer(function(int &$count) use($message) { + $count++; + if(3 === $count) { + return $message; + } + return null; + }); + $consumer->setPollingInterval(100); + + $start = microtime(true); + + $this->assertSame($message, $consumer->receive(250)); + + $timer = microtime(true) - $start; + + $this->assertGreaterThan(0.200, $timer); + $this->assertLessThan(0.205, $timer); + } +} From 81b4839a362bc374b7fcca7a99f7f27276186d0a Mon Sep 17 00:00:00 2001 From: Sylvain Fabre Date: Thu, 18 Oct 2018 22:56:33 +0200 Subject: [PATCH 46/60] missing strict definition --- tests/Spec/MessageTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/Spec/MessageTest.php b/tests/Spec/MessageTest.php index 3f01be3..8de379a 100644 --- a/tests/Spec/MessageTest.php +++ b/tests/Spec/MessageTest.php @@ -1,4 +1,6 @@ Date: Fri, 19 Oct 2018 10:47:46 +0200 Subject: [PATCH 47/60] renaming namespace --- tests/{Spec => Impl}/ConsumerPollingTest.php | 2 +- tests/{Spec => Impl}/MessageTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename tests/{Spec => Impl}/ConsumerPollingTest.php (97%) rename tests/{Spec => Impl}/MessageTest.php (94%) diff --git a/tests/Spec/ConsumerPollingTest.php b/tests/Impl/ConsumerPollingTest.php similarity index 97% rename from tests/Spec/ConsumerPollingTest.php rename to tests/Impl/ConsumerPollingTest.php index 44bd733..e0577bd 100644 --- a/tests/Spec/ConsumerPollingTest.php +++ b/tests/Impl/ConsumerPollingTest.php @@ -1,5 +1,5 @@ Date: Fri, 19 Oct 2018 10:56:11 +0200 Subject: [PATCH 48/60] review --- src/Impl/ConsumerPollingTrait.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Impl/ConsumerPollingTrait.php b/src/Impl/ConsumerPollingTrait.php index 6e0bfb4..1c83bd8 100644 --- a/src/Impl/ConsumerPollingTrait.php +++ b/src/Impl/ConsumerPollingTrait.php @@ -19,9 +19,10 @@ trait ConsumerPollingTrait /** * Set polling interval in milliseconds. */ - public function setPollingInterval(int $msec): void + public function setPollingInterval(int $msec): self { $this->pollingInterval = $msec; + return $this; } /** From 1a65a172d65ee42a1ae44696a968d191cda08297 Mon Sep 17 00:00:00 2001 From: Sylvain Fabre Date: Thu, 18 Oct 2018 22:58:22 +0200 Subject: [PATCH 49/60] visibility timeout --- src/Impl/ConsumerVisibilityTimeoutTrait.php | 30 ++++++++++++++++++++ tests/Spec/ConsumerVisibilityTimeoutTest.php | 25 ++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 src/Impl/ConsumerVisibilityTimeoutTrait.php create mode 100644 tests/Spec/ConsumerVisibilityTimeoutTest.php diff --git a/src/Impl/ConsumerVisibilityTimeoutTrait.php b/src/Impl/ConsumerVisibilityTimeoutTrait.php new file mode 100644 index 0000000..d919f4f --- /dev/null +++ b/src/Impl/ConsumerVisibilityTimeoutTrait.php @@ -0,0 +1,30 @@ +visibilityTimeout; + } + + /** + * The duration (in seconds) that the received messages are hidden from subsequent retrieve + * requests after being retrieved by a ReceiveMessage request. + */ + public function setVisibilityTimeout(int $visibilityTimeout = null): void + { + $this->visibilityTimeout = $visibilityTimeout; + } +} diff --git a/tests/Spec/ConsumerVisibilityTimeoutTest.php b/tests/Spec/ConsumerVisibilityTimeoutTest.php new file mode 100644 index 0000000..3f94340 --- /dev/null +++ b/tests/Spec/ConsumerVisibilityTimeoutTest.php @@ -0,0 +1,25 @@ +assertNull($consumer->getVisibilityTimeout()); + + $consumer->setVisibilityTimeout(123); + + $this->assertSame(123, $consumer->getVisibilityTimeout()); + } + +} \ No newline at end of file From c3a9716655ce9ebe5f80dce6ef41bbb15841b72f Mon Sep 17 00:00:00 2001 From: Sylvain Fabre Date: Fri, 19 Oct 2018 09:53:14 +0200 Subject: [PATCH 50/60] updating namespace --- tests/{Spec => Impl}/ConsumerVisibilityTimeoutTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename tests/{Spec => Impl}/ConsumerVisibilityTimeoutTest.php (93%) diff --git a/tests/Spec/ConsumerVisibilityTimeoutTest.php b/tests/Impl/ConsumerVisibilityTimeoutTest.php similarity index 93% rename from tests/Spec/ConsumerVisibilityTimeoutTest.php rename to tests/Impl/ConsumerVisibilityTimeoutTest.php index 3f94340..d6a7e9e 100644 --- a/tests/Spec/ConsumerVisibilityTimeoutTest.php +++ b/tests/Impl/ConsumerVisibilityTimeoutTest.php @@ -1,7 +1,7 @@ Date: Fri, 16 Nov 2018 11:08:14 +0200 Subject: [PATCH 51/60] add wamp transport --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 591488a..dbc09ca 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,7 @@ Find out more here: * [enqueue/dbal](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/dbal.md) * [enqueue/fs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/filesystem.md) * [enqueue/null](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/null.md) +* [enqueue/wamp](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/wamp.md) * [makasim/php-fpm-queue](https://github.com/makasim/php-fpm-queue) ## Amqp interop From cd379ee7bee4997f9691d0f9ca3fd39cd800f9b5 Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Fri, 16 Nov 2018 11:51:50 +0200 Subject: [PATCH 52/60] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d8d01e1..ecc679c 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ }, "require-dev": { "phpunit/phpunit": "^5.5", - "queue-interop/queue-spec": "0.6.x-dev" + "queue-interop/queue-spec": "^0.6@dev" }, "autoload": { "psr-4": { From b43af85f635439fa2c9a6d8fd486489da4869741 Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Thu, 22 Nov 2018 19:53:21 +0200 Subject: [PATCH 53/60] Add azure storage transport --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index dbc09ca..7c7286b 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,7 @@ Find out more here: * [enqueue/null](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/null.md) * [enqueue/wamp](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/wamp.md) * [makasim/php-fpm-queue](https://github.com/makasim/php-fpm-queue) +* [assoconnect/enqueue-azure](https://github.com/assoconnect/enqueue-azure) ## Amqp interop From 154320675cb7790d23c25f2aa5a14f08ccf4caca Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Mon, 11 Mar 2019 16:04:30 +0200 Subject: [PATCH 54/60] Update README.md --- README.md | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 7c7286b..079a2da 100644 --- a/README.md +++ b/README.md @@ -16,18 +16,7 @@ applications and projects that use MQs can depend on the common interfaces inste implementations. This facilitates a high-level of interoperability and flexibility that allows users to consume *any* MQ transport implementation that can be adapted to these interfaces. -The work done in this project is not officially endorsed by the [PHP-FIG](http://www.php-fig.org/). We adhere to the spirit and ideals of PHP-FIG, and hope -this project will pave the way for one or more future PSRs. - -## Roadmap - -The Queue Interop project started in the summer of 2016, almost two years ago. Since then It has been well-tried by many developers. A lot of companies use it in production. - -It is time to settle a date of a stable release and possibly some intermediate steps towards it: - -* The 1.0 will be released in December 2018. -* The 1.0-beta1 will be released in August 2018. -* The [1.0-alpha1](https://github.com/queue-interop/queue-interop/releases/tag/1.0.0-alpha1) will be released in March 2018. +The work done in this project is not officially endorsed by the [PHP-FIG](http://www.php-fig.org/). We adhere to the spirit and ideals of PHP-FIG. ## Installation @@ -90,6 +79,7 @@ Find out more here: * [vladimir-yuldashev/laravel-queue-rabbitmq](https://packagist.org/packages/vladimir-yuldashev/laravel-queue-rabbitmq) * [sonata-project/notification-bundle](https://github.com/sonata-project/SonataNotificationBundle) * [yiisoft/yii2-queue](https://github.com/yiisoft/yii2-queue) +* [queue-interop/ext](https://github.com/queue-interop/ext) - Queue Interop as PHP extension. Useful for Phalcon developers. ### Implementations @@ -100,6 +90,8 @@ Find out more here: * [enqueue/pheanstalk](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/pheanstalk.md) * [enqueue/stomp](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/stomp.md) * Amazon SQS [enqueue/sqs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/sqs.md) +* Amazon SNS [enqueue/sns](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/sns.md) +* Amazon SNS\SQS [enqueue/sns](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/snsqs.md) * Google PubSub [enqueue/gps](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/gps.md) * [enqueue/rdkafka](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/kafka.md) * [enqueue/redis](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport/redis.md) From 89b0d782788660705e2f9814f07d0547cd866eac Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Thu, 18 Apr 2019 09:34:29 +0300 Subject: [PATCH 55/60] Update README.md --- README.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/README.md b/README.md index 079a2da..f6b7110 100644 --- a/README.md +++ b/README.md @@ -124,15 +124,6 @@ There is [AMQP interop](https://packagist.org/packages/queue-interop/amqp-intero Everyone is welcome to join and contribute. -The general workflow looks like this: - -1. Someone opens a discussion (GitHub issue) to suggest an interface -1. Feedback is gathered -1. The interface is added to a development branch -1. We release alpha versions so that the interface can be experimented with -1. Discussions and edits ensue until the interface is deemed stable by a general consensus -1. A new minor version of the package is released - We try to not break BC by creating new interfaces instead of editing existing ones. While we currently work on interfaces, we are open to anything that might help towards interoperability, may that From b7c856b5f280588f43997bf771df12de011f4a1c Mon Sep 17 00:00:00 2001 From: SAMUEL NELA Date: Mon, 8 Jul 2019 22:46:03 +0200 Subject: [PATCH 56/60] Fixed typos --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f6b7110..a04641f 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ if ($message = $consumer->receive($timeout)) { Find out more here: * [Enqueue transport docs](https://github.com/php-enqueue/enqueue-dev/tree/master/docs/transport) contains a lot how to use example. -* [Formapro's Blog](https://blog.forma-pro.com) contains varitety blog post about Queue Interop useage. +* [Formapro's Blog](https://blog.forma-pro.com) contains variety blog post about Queue Interop usage. * [RabbitMQ's official tutorials](https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/php-interop) ported to AMQP Interop. ## Compatible projects From 97937244149b30804058a6e6e3b8fc3b33cd8adc Mon Sep 17 00:00:00 2001 From: Bence Szalai Date: Sat, 11 Jul 2020 15:12:55 +0200 Subject: [PATCH 57/60] Fixed example in README.md The "Consume a message" example used an undefined variable. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a04641f..ebc2e98 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ use Enqueue\Fs\FsConnectionFactory; $context = (new FsConnectionFactory())->createContext(); -$consumer = $consumer->createConsumer($context->createQueue('aQueue')); +$consumer = $context->createConsumer($context->createQueue('aQueue')); $timeout = 5000; // 5sec if ($message = $consumer->receive($timeout)) { From 6311c180cf5395436e1e2ac5b62542039659d8ff Mon Sep 17 00:00:00 2001 From: Roman Varkuta Date: Fri, 27 Nov 2020 00:13:24 +0200 Subject: [PATCH 58/60] PHP8 Support --- .gitignore | 2 + .travis.yml | 5 +- composer.json | 4 +- composer.lock | 1443 ------------------------------------------------- 4 files changed, 8 insertions(+), 1446 deletions(-) delete mode 100644 composer.lock diff --git a/.gitignore b/.gitignore index ed70c79..55b84c1 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /vendor/* +composer.lock +.phpunit.result.cache diff --git a/.travis.yml b/.travis.yml index 5426e2e..fd4cfe7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,9 @@ language: php php: - '7.1' - '7.2' + - '7.3' + - '7.4' + - '8.0' cache: directories: @@ -18,4 +21,4 @@ install: - composer install --prefer-source script: - - vendor/bin/phpunit \ No newline at end of file + - vendor/bin/phpunit diff --git a/composer.json b/composer.json index ecc679c..c26a252 100644 --- a/composer.json +++ b/composer.json @@ -6,10 +6,10 @@ "homepage": "https://github.com/queue-interop/queue-interop", "license": "MIT", "require": { - "php": "^7.1.3" + "php": "^7.1.3 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^5.5", + "phpunit/phpunit": "^5.5 || ^6.0 || ^7.0 || ^8.0 || ^9.0", "queue-interop/queue-spec": "^0.6@dev" }, "autoload": { diff --git a/composer.lock b/composer.lock deleted file mode 100644 index f1ac575..0000000 --- a/composer.lock +++ /dev/null @@ -1,1443 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "7d749e1d9b9326ec9413073deba2c9a3", - "packages": [], - "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "^6.2.3", - "squizlabs/php_codesniffer": "^3.0.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2017-07-22T11:58:36+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.8.1", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "replace": { - "myclabs/deep-copy": "self.version" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "time": "2018-06-11T23:09:50+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "^4.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "time": "2017-09-11T18:02:19+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "4.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08", - "shasum": "" - }, - "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0", - "phpdocumentor/type-resolver": "^0.4.0", - "webmozart/assert": "^1.0" - }, - "require-dev": { - "doctrine/instantiator": "~1.0.5", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-11-30T07:14:17+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "0.4.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", - "shasum": "" - }, - "require": { - "php": "^5.5 || ^7.0", - "phpdocumentor/reflection-common": "^1.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "time": "2017-07-14T14:27:02+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "1.8.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.8.x-dev" - } - }, - "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2018-08-05T17:53:17+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "4.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "^1.3", - "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.2 || ^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0", - "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "^1.0 || ^2.0" - }, - "require-dev": { - "ext-xdebug": "^2.1.4", - "phpunit/phpunit": "^5.7" - }, - "suggest": { - "ext-xdebug": "^2.5.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2017-04-02T07:44:40+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2017-11-27T13:52:08+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.9", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2017-02-26T11:10:40+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "791198a2c6254db10131eecfe8c06670700904db" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", - "reference": "791198a2c6254db10131eecfe8c06670700904db", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.2.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2017-11-27T05:48:46+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "5.7.27", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.6.2", - "phpunit/php-code-coverage": "^4.0.4", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "^1.2.4", - "sebastian/diff": "^1.4.3", - "sebastian/environment": "^1.3.4 || ^2.0", - "sebastian/exporter": "~2.0", - "sebastian/global-state": "^1.1", - "sebastian/object-enumerator": "~2.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "^1.0.6|^2.0.1", - "symfony/yaml": "~2.1|~3.0|~4.0" - }, - "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2" - }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-xdebug": "*", - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.7.x-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": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2018-02-01T05:50:59+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "3.4.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2 || ^2.0" - }, - "conflict": { - "phpunit/phpunit": "<5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.4" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2017-06-30T09:13:00+00:00" - }, - { - "name": "queue-interop/queue-spec", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/queue-interop/queue-spec.git", - "reference": "0a8dae210db1362cd27e8ac6ef72914fda609827" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/queue-interop/queue-spec/zipball/0a8dae210db1362cd27e8ac6ef72914fda609827", - "reference": "0a8dae210db1362cd27e8ac6ef72914fda609827", - "shasum": "" - }, - "require": { - "queue-interop/queue-interop": "0.7.x-dev" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.6.x-dev" - } - }, - "autoload": { - "psr-4": { - "Interop\\Queue\\Spec\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "time": "2018-09-28T12:20:50+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" - }, - { - "name": "sebastian/comparator", - "version": "1.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2017-01-29T09:50:25+00:00" - }, - { - "name": "sebastian/diff", - "version": "1.4.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "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" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2017-05-22T07:24:03+00:00" - }, - { - "name": "sebastian/environment", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2016-11-26T07:53:53+00:00" - }, - { - "name": "sebastian/exporter", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~2.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "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" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2016-11-19T08:54:04+00:00" - }, - { - "name": "sebastian/global-state", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2015-10-12T03:26:01+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", - "shasum": "" - }, - "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-02-18T15:18:39+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-11-19T07:33:16+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "shasum": "" - }, - "require": { - "php": ">=5.6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" - }, - { - "name": "sebastian/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-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": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.9.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - }, - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "time": "2018-08-06T14:22:27+00:00" - }, - { - "name": "symfony/yaml", - "version": "v4.1.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "367e689b2fdc19965be435337b50bc8adf2746c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/367e689b2fdc19965be435337b50bc8adf2746c9", - "reference": "367e689b2fdc19965be435337b50bc8adf2746c9", - "shasum": "" - }, - "require": { - "php": "^7.1.3", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<3.4" - }, - "require-dev": { - "symfony/console": "~3.4|~4.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.1-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2018-10-02T16:36:10+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "time": "2018-01-29T19:49:41+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": { - "queue-interop/queue-spec": 20 - }, - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": "^7.1.3" - }, - "platform-dev": [] -} From 0635a95cec9839f042a290ff2b8e59f1b0a0eb09 Mon Sep 17 00:00:00 2001 From: Roman Varkuta Date: Wed, 2 Dec 2020 15:42:05 +0300 Subject: [PATCH 59/60] Update .travis.yml Co-authored-by: Martins Sipenko --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fd4cfe7..7282ffe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ php: - '7.2' - '7.3' - '7.4' - - '8.0' + - '8.0snapshot' cache: directories: From 36d5b172f1c1ae040ee302814eb24d606bf9a2e8 Mon Sep 17 00:00:00 2001 From: Marcin Michalski Date: Fri, 29 Nov 2024 21:14:20 +0100 Subject: [PATCH 60/60] Explicit nullable types --- src/Exception/DeliveryDelayNotSupportedException.php | 6 +++--- src/Exception/PriorityNotSupportedException.php | 4 ++-- src/Exception/PurgeQueueNotSupportedException.php | 4 ++-- .../SubscriptionConsumerNotSupportedException.php | 4 ++-- src/Exception/TemporaryQueueNotSupportedException.php | 4 ++-- src/Exception/TimeToLiveNotSupportedException.php | 4 ++-- src/Impl/ConsumerVisibilityTimeoutTrait.php | 2 +- src/Impl/MessageTrait.php | 8 ++++---- src/Message.php | 10 +++++----- src/Producer.php | 8 ++++---- 10 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/Exception/DeliveryDelayNotSupportedException.php b/src/Exception/DeliveryDelayNotSupportedException.php index 3b8310d..97f14df 100644 --- a/src/Exception/DeliveryDelayNotSupportedException.php +++ b/src/Exception/DeliveryDelayNotSupportedException.php @@ -7,12 +7,12 @@ class DeliveryDelayNotSupportedException extends Exception { /** * @param int $code - * @param \Throwable $previous + * @param \Throwable|null $previous * * @return static */ - public static function providerDoestNotSupportIt(int $code = 0, \Throwable $previous = null): self + public static function providerDoestNotSupportIt(int $code = 0, ?\Throwable $previous = null): self { return new static('The provider does not support delivery delay feature', $code, $previous); } -} \ No newline at end of file +} diff --git a/src/Exception/PriorityNotSupportedException.php b/src/Exception/PriorityNotSupportedException.php index cb79721..1e5de28 100644 --- a/src/Exception/PriorityNotSupportedException.php +++ b/src/Exception/PriorityNotSupportedException.php @@ -7,11 +7,11 @@ class PriorityNotSupportedException extends Exception { /** * @param int $code - * @param \Throwable $previous + * @param \Throwable|null $previous * * @return static */ - public static function providerDoestNotSupportIt(int $code = 0, \Throwable $previous = null): self + public static function providerDoestNotSupportIt(int $code = 0, ?\Throwable $previous = null): self { return new static('The provider does not support priority feature', $code, $previous); } diff --git a/src/Exception/PurgeQueueNotSupportedException.php b/src/Exception/PurgeQueueNotSupportedException.php index 0dd33e2..49d0499 100644 --- a/src/Exception/PurgeQueueNotSupportedException.php +++ b/src/Exception/PurgeQueueNotSupportedException.php @@ -7,11 +7,11 @@ class PurgeQueueNotSupportedException extends Exception { /** * @param int $code - * @param \Throwable $previous + * @param \Throwable|null $previous * * @return static */ - public static function providerDoestNotSupportIt(int $code = 0, \Throwable $previous = null): self + public static function providerDoestNotSupportIt(int $code = 0, ?\Throwable $previous = null): self { return new static('The provider does not support purge queue.', $code, $previous); } diff --git a/src/Exception/SubscriptionConsumerNotSupportedException.php b/src/Exception/SubscriptionConsumerNotSupportedException.php index b843b01..a0fa48a 100644 --- a/src/Exception/SubscriptionConsumerNotSupportedException.php +++ b/src/Exception/SubscriptionConsumerNotSupportedException.php @@ -7,11 +7,11 @@ class SubscriptionConsumerNotSupportedException extends Exception { /** * @param int $code - * @param \Throwable $previous + * @param \Throwable|null $previous * * @return static */ - public static function providerDoestNotSupportIt(int $code = 0, \Throwable $previous = null): self + public static function providerDoestNotSupportIt(int $code = 0, ?\Throwable $previous = null): self { return new static('The provider does not support subscription consumer.', $code, $previous); } diff --git a/src/Exception/TemporaryQueueNotSupportedException.php b/src/Exception/TemporaryQueueNotSupportedException.php index 04f65ad..d783cec 100644 --- a/src/Exception/TemporaryQueueNotSupportedException.php +++ b/src/Exception/TemporaryQueueNotSupportedException.php @@ -7,11 +7,11 @@ class TemporaryQueueNotSupportedException extends Exception { /** * @param int $code - * @param \Throwable $previous + * @param \Throwable|null $previous * * @return static */ - public static function providerDoestNotSupportIt(int $code = 0, \Throwable $previous = null): self + public static function providerDoestNotSupportIt(int $code = 0, ?\Throwable $previous = null): self { return new static('The provider does not support temporary queue feature', $code, $previous); } diff --git a/src/Exception/TimeToLiveNotSupportedException.php b/src/Exception/TimeToLiveNotSupportedException.php index b56b751..1cb90d5 100644 --- a/src/Exception/TimeToLiveNotSupportedException.php +++ b/src/Exception/TimeToLiveNotSupportedException.php @@ -7,11 +7,11 @@ class TimeToLiveNotSupportedException extends Exception { /** * @param int $code - * @param \Throwable $previous + * @param \Throwable|null $previous * * @return static */ - public static function providerDoestNotSupportIt(int $code = 0, \Throwable $previous = null): self + public static function providerDoestNotSupportIt(int $code = 0, ?\Throwable $previous = null): self { return new static('The provider does not support time to live feature', $code, $previous); } diff --git a/src/Impl/ConsumerVisibilityTimeoutTrait.php b/src/Impl/ConsumerVisibilityTimeoutTrait.php index d919f4f..06c5f62 100644 --- a/src/Impl/ConsumerVisibilityTimeoutTrait.php +++ b/src/Impl/ConsumerVisibilityTimeoutTrait.php @@ -23,7 +23,7 @@ public function getVisibilityTimeout(): ?int * The duration (in seconds) that the received messages are hidden from subsequent retrieve * requests after being retrieved by a ReceiveMessage request. */ - public function setVisibilityTimeout(int $visibilityTimeout = null): void + public function setVisibilityTimeout(?int $visibilityTimeout = null): void { $this->visibilityTimeout = $visibilityTimeout; } diff --git a/src/Impl/MessageTrait.php b/src/Impl/MessageTrait.php index ee014a9..d1b3906 100644 --- a/src/Impl/MessageTrait.php +++ b/src/Impl/MessageTrait.php @@ -97,7 +97,7 @@ public function isRedelivered(): bool return $this->redelivered; } - public function setCorrelationId(string $correlationId = null): void + public function setCorrelationId(?string $correlationId = null): void { $this->setHeader('correlation_id', $correlationId); } @@ -107,7 +107,7 @@ public function getCorrelationId(): ?string return $this->getHeader('correlation_id'); } - public function setMessageId(string $messageId = null): void + public function setMessageId(?string $messageId = null): void { $this->setHeader('message_id', $messageId); } @@ -124,12 +124,12 @@ public function getTimestamp(): ?int return null === $value ? null : (int) $value; } - public function setTimestamp(int $timestamp = null): void + public function setTimestamp(?int $timestamp = null): void { $this->setHeader('timestamp', $timestamp); } - public function setReplyTo(string $replyTo = null): void + public function setReplyTo(?string $replyTo = null): void { $this->setHeader('reply_to', $replyTo); } diff --git a/src/Message.php b/src/Message.php index 5433763..d7eb39f 100644 --- a/src/Message.php +++ b/src/Message.php @@ -57,7 +57,7 @@ public function isRedelivered(): bool; * A client can use the correlation header field to link one message with another. * A typical use is to link a response message with its request message. */ - public function setCorrelationId(string $correlationId = null): void; + public function setCorrelationId(?string $correlationId = null): void; /** * Gets the correlation ID for the message. @@ -71,7 +71,7 @@ public function getCorrelationId(): ?string; * Providers set this field when a message is sent. * This method can be used to change the value for a message that has been received. */ - public function setMessageId(string $messageId = null): void; + public function setMessageId(?string $messageId = null): void; /** * Gets the message Id. @@ -94,7 +94,7 @@ public function getTimestamp(): ?int; * Providers set this field when a message is sent. * This method can be used to change the value for a message that has been received. */ - public function setTimestamp(int $timestamp = null): void; + public function setTimestamp(?int $timestamp = null): void; /** * Sets the destination to which a reply to this message should be sent. @@ -108,10 +108,10 @@ public function setTimestamp(int $timestamp = null): void; * The client can use the CorrelationID header field for this purpose. */ - public function setReplyTo(string $replyTo = null): void; + public function setReplyTo(?string $replyTo = null): void; /** * Gets the destination to which a reply to this message should be sent. */ public function getReplyTo(): ?string; -} \ No newline at end of file +} diff --git a/src/Producer.php b/src/Producer.php index 8cc0bab..017b1ae 100644 --- a/src/Producer.php +++ b/src/Producer.php @@ -26,7 +26,7 @@ public function send(Destination $destination, Message $message): void; * * @throws DeliveryDelayNotSupportedException if producer does not support delivery delay feature */ - public function setDeliveryDelay(int $deliveryDelay = null): self; + public function setDeliveryDelay(?int $deliveryDelay = null): self; /** * Gets the minimum length of time in milliseconds that must elapse after a message is sent before the provider may deliver the message to a consumer. @@ -45,7 +45,7 @@ public function getDeliveryDelay(): ?int; * * @throws PriorityNotSupportedException if producer does not support priority feature */ - public function setPriority(int $priority = null): self; + public function setPriority(?int $priority = null): self; /** * Return the priority of messages that are sent using this Producer @@ -65,7 +65,7 @@ public function getPriority(): ?int; * * @throws TimeToLiveNotSupportedException if producer does not support time to live feature */ - public function setTimeToLive(int $timeToLive = null): self; + public function setTimeToLive(?int $timeToLive = null): self; /** * Returns the time to live of messages that are sent using this JMSProducer. @@ -73,4 +73,4 @@ public function setTimeToLive(int $timeToLive = null): self; * @return int|null the message time to live in milliseconds; a value of zero means that a message never expires. */ public function getTimeToLive(): ?int; -} \ No newline at end of file +}