Skip to content

Commit

Permalink
Rename package (#91)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Makarov <[email protected]>
Co-authored-by: Sergei Predvoditelev <[email protected]>
  • Loading branch information
3 people authored Jan 9, 2024
1 parent f8e582b commit e87aeae
Show file tree
Hide file tree
Showing 37 changed files with 228 additions and 344 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
<br>
</p>

AMQP adapter based on [php-amqplib](https://github.com/php-amqplib/php-amqplib) package for [Yii Queue](https://github.com/yiisoft/yii-queue).
AMQP adapter based on [php-amqplib](https://github.com/php-amqplib/php-amqplib) package for [Yii Queue](https://github.com/yiisoft/queue).

[![Latest Stable Version](https://poser.pugx.org/yiisoft/yii-queue-amqp/v/stable.png)](https://packagist.org/packages/yiisoft/yii-queue-amqp)
[![Total Downloads](https://poser.pugx.org/yiisoft/yii-queue-amqp/downloads.png)](https://packagist.org/packages/yiisoft/yii-queue-amqp)
[![Build status](https://github.com/yiisoft/yii-queue-amqp/workflows/build/badge.svg)](https://github.com/yiisoft/yii-queue-amqp/actions?query=workflow%3Abuild)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/yiisoft/yii-queue-amqp/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/yiisoft/yii-queue-amqp/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/yiisoft/yii-queue-amqp/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/yiisoft/yii-queue-amqp/?branch=master)
[![static analysis](https://github.com/yiisoft/yii-queue-amqp/workflows/static%20analysis/badge.svg)](https://github.com/yiisoft/yii-queue-amqp/actions?query=workflow%3A%22static+analysis%22)
[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyiisoft%2Fyii-queue-amqp%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/yii-queue-amqp/master)
[![type-coverage](https://shepherd.dev/github/yiisoft/yii-queue-amqp/coverage.svg)](https://shepherd.dev/github/yiisoft/yii-queue-amqp)
[![Latest Stable Version](https://poser.pugx.org/yiisoft/queue-amqp/v/stable.png)](https://packagist.org/packages/yiisoft/queue-amqp)
[![Total Downloads](https://poser.pugx.org/yiisoft/queue-amqp/downloads.png)](https://packagist.org/packages/yiisoft/queue-amqp)
[![Build status](https://github.com/yiisoft/queue-amqp/workflows/build/badge.svg)](https://github.com/yiisoft/queue-amqp/actions?query=workflow%3Abuild)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/yiisoft/queue-amqp/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/yiisoft/queue-amqp/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/yiisoft/queue-amqp/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/yiisoft/queue-amqp/?branch=master)
[![static analysis](https://github.com/yiisoft/queue-amqp/workflows/static%20analysis/badge.svg)](https://github.com/yiisoft/queue-amqp/actions?query=workflow%3A%22static+analysis%22)
[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyiisoft%2Fqueue-amqp%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/queue-amqp/master)
[![type-coverage](https://shepherd.dev/github/yiisoft/queue-amqp/coverage.svg)](https://shepherd.dev/github/yiisoft/queue-amqp)

## Requirements

Expand All @@ -28,13 +28,13 @@ The preferred way to install this extension is through [composer](http://getcomp
Either run

```shell
composer require yiisoft/yii-queue-amqp
composer require yiisoft/queue-amqp
```

or add

```
"yiisoft/yii-queue-amqp": "dev-master"
"yiisoft/queue-amqp": "dev-master"
```

to the `require` section of your `composer.json` file.
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "yiisoft/yii-queue-amqp",
"name": "yiisoft/queue-amqp",
"type": "library",
"description": "yii-queue amqp adapter based on amqp-lib package",
"description": "Yii Queue AMQP adapter based on amqp-lib package",
"keywords": [
"yii",
"queue",
Expand All @@ -12,12 +12,12 @@
"homepage": "https://www.yiiframework.com/",
"license": "BSD-3-Clause",
"support": {
"issues": "https://github.com/yiisoft/yii-queue-amqp/issues?state=open",
"issues": "https://github.com/yiisoft/queue-amqp/issues?state=open",
"forum": "https://www.yiiframework.com/forum/",
"wiki": "https://www.yiiframework.com/wiki/",
"irc": "irc://irc.freenode.net/yii",
"chat": "https://t.me/yii3en",
"source": "https://github.com/yiisoft/yii-queue-amqp"
"source": "https://github.com/yiisoft/queue-amqp"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand All @@ -28,7 +28,7 @@
"php-amqplib/php-amqplib": "^3.1.0",
"yiisoft/factory": "^1.0",
"yiisoft/friendly-exception": "^1.0",
"yiisoft/yii-queue": "dev-master"
"yiisoft/queue": "dev-master"
},
"require-dev": {
"maglnet/composer-require-checker": "^4.4",
Expand All @@ -43,12 +43,12 @@
},
"autoload": {
"psr-4": {
"Yiisoft\\Yii\\Queue\\AMQP\\": "src"
"Yiisoft\\Queue\\AMQP\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Yiisoft\\Yii\\Queue\\AMQP\\Tests\\": "tests"
"Yiisoft\\Queue\\AMQP\\Tests\\": "tests"
}
},
"extra": {
Expand Down
12 changes: 6 additions & 6 deletions config/di.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

use Yiisoft\Yii\Queue\AMQP\MessageSerializer;
use Yiisoft\Yii\Queue\AMQP\MessageSerializerInterface;
use Yiisoft\Yii\Queue\AMQP\QueueProvider;
use Yiisoft\Yii\Queue\AMQP\QueueProviderInterface;
use Yiisoft\Yii\Queue\AMQP\Settings\Queue;
use Yiisoft\Yii\Queue\AMQP\Settings\QueueSettingsInterface;
use Yiisoft\Queue\AMQP\MessageSerializer;
use Yiisoft\Queue\AMQP\MessageSerializerInterface;
use Yiisoft\Queue\AMQP\QueueProvider;
use Yiisoft\Queue\AMQP\QueueProviderInterface;
use Yiisoft\Queue\AMQP\Settings\Queue;
use Yiisoft\Queue\AMQP\Settings\QueueSettingsInterface;

return [
MessageSerializerInterface::class => MessageSerializer::class,
Expand Down
2 changes: 1 addition & 1 deletion docs/en/internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ You can use any of the supported PHP versions with service names `php80`, `php81
To debug code with xDebug and to use volumes inside the built containers, you can use
`test/docker-compose.development.yml`. To do so you should either run
`docker compose -f docker-compose.yml -f docker-compose.development.yml run --rm php<version> vendor/bin/phpunit`
or copy [tests/.env.example](tests/.env.example) into `tests/.env` and run tests as usual.
or copy [tests/.env.example](../../tests/.env.example) into `tests/.env` and run tests as usual.

Also, if you are using Docker, then you have access to a set of prepared commands in the Makefile

Expand Down
8 changes: 1 addition & 7 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,8 @@
>
<coverage>
<include>
<directory>./</directory>
<directory>src</directory>
</include>
<exclude>
<directory>./tests</directory>
<directory>./vendor</directory>
<directory>./config</directory>
<file>./rector.php</file>
</exclude>
</coverage>
<php>
<ini name="error_reporting" value="-1"/>
Expand Down
12 changes: 6 additions & 6 deletions src/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

declare(strict_types=1);

namespace Yiisoft\Yii\Queue\AMQP;
namespace Yiisoft\Queue\AMQP;

use PhpAmqpLib\Message\AMQPMessage;
use Throwable;
use Yiisoft\Yii\Queue\Adapter\AdapterInterface;
use Yiisoft\Yii\Queue\AMQP\Exception\NotImplementedException;
use Yiisoft\Yii\Queue\Cli\LoopInterface;
use Yiisoft\Yii\Queue\Enum\JobStatus;
use Yiisoft\Yii\Queue\Message\MessageInterface;
use Yiisoft\Queue\Adapter\AdapterInterface;
use Yiisoft\Queue\AMQP\Exception\NotImplementedException;
use Yiisoft\Queue\Cli\LoopInterface;
use Yiisoft\Queue\Enum\JobStatus;
use Yiisoft\Queue\Message\MessageInterface;

final class Adapter implements AdapterInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/ExchangeDeclaredException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Yiisoft\Yii\Queue\AMQP\Exception;
namespace Yiisoft\Queue\AMQP\Exception;

use InvalidArgumentException;
use Yiisoft\FriendlyException\FriendlyExceptionInterface;
Expand Down
16 changes: 11 additions & 5 deletions src/Exception/NoKeyInPayloadException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

declare(strict_types=1);

namespace Yiisoft\Yii\Queue\AMQP\Exception;
namespace Yiisoft\Queue\AMQP\Exception;

use InvalidArgumentException;
use Throwable;
use Yiisoft\FriendlyException\FriendlyExceptionInterface;
use Yiisoft\Queue\AMQP\MessageSerializerInterface;

class NoKeyInPayloadException extends InvalidArgumentException implements FriendlyExceptionInterface
{
Expand Down Expand Up @@ -40,9 +41,14 @@ public function getName(): string
*/
public function getSolution(): ?string
{
return 'We have successfully unserialized a message, but there was no expected key "' . $this->expectedKey . '".
There are the following keys in the message: ' . implode(', ', array_keys($this->payload)) . '.
You might want to change message\'s structure, or make your own implementation of \\Yiisoft\\Yii\\Queue\\AMQP\\MessageSerializerInterface,
which won\'t rely on this key in the message.';
return sprintf(
"We have successfully unserialized a message, but there was no expected key \"%s\".
There are the following keys in the message: %s.
You might want to change message's structure, or make your own implementation of %s,
which won't rely on this key in the message.",
$this->expectedKey,
implode(', ', array_keys($this->payload)),
MessageSerializerInterface::class
);
}
}
2 changes: 1 addition & 1 deletion src/Exception/NotImplementedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Yiisoft\Yii\Queue\AMQP\Exception;
namespace Yiisoft\Queue\AMQP\Exception;

use RuntimeException;

Expand Down
4 changes: 2 additions & 2 deletions src/ExistingMessagesConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

namespace Yiisoft\Yii\Queue\AMQP;
namespace Yiisoft\Queue\AMQP;

use PhpAmqpLib\Channel\AMQPChannel;
use PhpAmqpLib\Message\AMQPMessage;
use Throwable;
use Yiisoft\Yii\Queue\Message\MessageInterface;
use Yiisoft\Queue\Message\MessageInterface;

/**
* @internal
Expand Down
8 changes: 4 additions & 4 deletions src/MessageSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

declare(strict_types=1);

namespace Yiisoft\Yii\Queue\AMQP;
namespace Yiisoft\Queue\AMQP;

use InvalidArgumentException;
use JsonException;
use Yiisoft\Yii\Queue\AMQP\Exception\NoKeyInPayloadException;
use Yiisoft\Yii\Queue\Message\Message;
use Yiisoft\Yii\Queue\Message\MessageInterface;
use Yiisoft\Queue\AMQP\Exception\NoKeyInPayloadException;
use Yiisoft\Queue\Message\Message;
use Yiisoft\Queue\Message\MessageInterface;

class MessageSerializer implements MessageSerializerInterface
{
Expand Down
4 changes: 2 additions & 2 deletions src/MessageSerializerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Yiisoft\Yii\Queue\AMQP;
namespace Yiisoft\Queue\AMQP;

use Yiisoft\Yii\Queue\Message\MessageInterface;
use Yiisoft\Queue\Message\MessageInterface;

interface MessageSerializerInterface
{
Expand Down
16 changes: 8 additions & 8 deletions src/Middleware/DelayMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

declare(strict_types=1);

namespace Yiisoft\Yii\Queue\AMQP\Middleware;
namespace Yiisoft\Queue\AMQP\Middleware;

use InvalidArgumentException;
use PhpAmqpLib\Exchange\AMQPExchangeType;
use PhpAmqpLib\Message\AMQPMessage;
use Yiisoft\Yii\Queue\AMQP\Adapter;
use Yiisoft\Yii\Queue\AMQP\QueueProviderInterface;
use Yiisoft\Yii\Queue\AMQP\Settings\ExchangeSettingsInterface;
use Yiisoft\Yii\Queue\AMQP\Settings\QueueSettingsInterface;
use Yiisoft\Yii\Queue\Middleware\Push\Implementation\DelayMiddlewareInterface;
use Yiisoft\Yii\Queue\Middleware\Push\MessageHandlerPushInterface;
use Yiisoft\Yii\Queue\Middleware\Push\PushRequest;
use Yiisoft\Queue\AMQP\Adapter;
use Yiisoft\Queue\AMQP\QueueProviderInterface;
use Yiisoft\Queue\AMQP\Settings\ExchangeSettingsInterface;
use Yiisoft\Queue\AMQP\Settings\QueueSettingsInterface;
use Yiisoft\Queue\Middleware\Push\Implementation\DelayMiddlewareInterface;
use Yiisoft\Queue\Middleware\Push\MessageHandlerPushInterface;
use Yiisoft\Queue\Middleware\Push\PushRequest;

final class DelayMiddleware implements DelayMiddlewareInterface
{
Expand Down
10 changes: 5 additions & 5 deletions src/QueueProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

declare(strict_types=1);

namespace Yiisoft\Yii\Queue\AMQP;
namespace Yiisoft\Queue\AMQP;

use PhpAmqpLib\Channel\AMQPChannel;
use PhpAmqpLib\Connection\AbstractConnection;
use Yiisoft\Yii\Queue\AMQP\Exception\ExchangeDeclaredException;
use Yiisoft\Yii\Queue\AMQP\Settings\Exchange;
use Yiisoft\Yii\Queue\AMQP\Settings\ExchangeSettingsInterface;
use Yiisoft\Yii\Queue\AMQP\Settings\QueueSettingsInterface;
use Yiisoft\Queue\AMQP\Exception\ExchangeDeclaredException;
use Yiisoft\Queue\AMQP\Settings\Exchange;
use Yiisoft\Queue\AMQP\Settings\ExchangeSettingsInterface;
use Yiisoft\Queue\AMQP\Settings\QueueSettingsInterface;

final class QueueProvider implements QueueProviderInterface
{
Expand Down
6 changes: 3 additions & 3 deletions src/QueueProviderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace Yiisoft\Yii\Queue\AMQP;
namespace Yiisoft\Queue\AMQP;

use PhpAmqpLib\Channel\AMQPChannel;
use Yiisoft\Yii\Queue\AMQP\Settings\ExchangeSettingsInterface;
use Yiisoft\Yii\Queue\AMQP\Settings\QueueSettingsInterface;
use Yiisoft\Queue\AMQP\Settings\ExchangeSettingsInterface;
use Yiisoft\Queue\AMQP\Settings\QueueSettingsInterface;

interface QueueProviderInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Settings/Exchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Yiisoft\Yii\Queue\AMQP\Settings;
namespace Yiisoft\Queue\AMQP\Settings;

use PhpAmqpLib\Exchange\AMQPExchangeType;
use PhpAmqpLib\Wire\AMQPTable;
Expand Down
4 changes: 2 additions & 2 deletions src/Settings/ExchangeSettingsInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Yiisoft\Yii\Queue\AMQP\Settings;
namespace Yiisoft\Queue\AMQP\Settings;

use PhpAmqpLib\Wire\AMQPTable;

Expand All @@ -29,7 +29,7 @@ public function isPassive(): bool;
/**
* Positional arguments to be used with {@see \PhpAmqpLib\Channel\AMQPChannel::exchange_declare()}
*
* @see \Yiisoft\Yii\Queue\AMQP\QueueProvider::getChannel()
* @see \Yiisoft\Queue\AMQP\QueueProvider::getChannel()
*
* @return (AMQPTable|array|bool|int|string|null)[]
*
Expand Down
4 changes: 2 additions & 2 deletions src/Settings/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Yiisoft\Yii\Queue\AMQP\Settings;
namespace Yiisoft\Queue\AMQP\Settings;

use PhpAmqpLib\Wire\AMQPTable;
use Yiisoft\Yii\Queue\QueueFactoryInterface;
use Yiisoft\Queue\QueueFactoryInterface;

final class Queue implements QueueSettingsInterface
{
Expand Down
4 changes: 2 additions & 2 deletions src/Settings/QueueSettingsInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Yiisoft\Yii\Queue\AMQP\Settings;
namespace Yiisoft\Queue\AMQP\Settings;

use PhpAmqpLib\Wire\AMQPTable;

Expand All @@ -27,7 +27,7 @@ public function isPassive(): bool;
/**
* Returns positional arguments to be used with {@see \PhpAmqpLib\Channel\AMQPChannel::queue_declare()}
*
* @see \Yiisoft\Yii\Queue\AMQP\QueueProvider::getChannel()
* @see \Yiisoft\Queue\AMQP\QueueProvider::getChannel()
*
* @return (AMQPTable|array|bool|int|string|null)[]
*
Expand Down
Loading

0 comments on commit e87aeae

Please sign in to comment.