diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index eee2a5372..ae398fc2d 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -28,5 +28,4 @@ jobs: phpcs: uses: yiisoft/yii2-actions/.github/workflows/linter.yml@master with: - directories: src/ tests/ extensions: 'amqp' diff --git a/README.md b/README.md index 7fc02a8fd..a7b25c1e7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@

- - - + + + + Yii Framework +

Yii2 Queue Extension


@@ -10,13 +12,11 @@ An extension for running tasks asynchronously via queues. It supports queues based on **DB**, **Redis**, **RabbitMQ**, **AMQP**, **Beanstalk**, **ActiveMQ** and **Gearman**. -Documentation is at [docs/guide/README.md](docs/guide/README.md). - -[![Latest Stable Version](https://poser.pugx.org/yiisoft/yii2-queue/v/stable.svg)](https://packagist.org/packages/yiisoft/yii2-queue) -[![Total Downloads](https://poser.pugx.org/yiisoft/yii2-queue/downloads.svg)](https://packagist.org/packages/yiisoft/yii2-queue) -[![Build Status](https://github.com/yiisoft/yii2-queue/workflows/build/badge.svg)](https://github.com/yiisoft/yii2-queue/actions) -[![Static status](https://github.com/yiisoft/yii2-queue/workflows/static%20analysis/badge.svg)](https://github.com/yiisoft/yii2-queue/actions?query=workflow%3A%22static+analysis%22) -[![codecov](https://codecov.io/gh/yiisoft/yii2-queue/graph/badge.svg)](https://codecov.io/gh/yiisoft/yii2-queue) +[![Latest Stable Version](https://img.shields.io/packagist/v/yiisoft/yii2-queue.svg?style=for-the-badge&label=Stable&logo=packagist)](https://packagist.org/packages/yiisoft/yii2-queue) +[![Total Downloads](https://img.shields.io/packagist/dt/yiisoft/yii2-queue.svg?style=for-the-badge&label=Downloads)](https://packagist.org/packages/yiisoft/yii2-queue) +[![build](https://img.shields.io/github/actions/workflow/status/yiisoft/yii2-queue/main.yml?style=for-the-badge&logo=github&label=Build)](https://github.com/yiisoft/yii2-queue/actions?query=workflow%3Abuild) +[![codecov](https://img.shields.io/codecov/c/github/yiisoft/yii2-queue.svg?style=for-the-badge&logo=codecov&logoColor=white&label=Codecov)](https://codecov.io/gh/yiisoft/yii2-queue) +[![Static Analysis](https://img.shields.io/github/actions/workflow/status/yiisoft/yii2-queue/static.yml?style=for-the-badge&label=Static)](https://github.com/yiisoft/yii2-queue/actions/workflows/static.yml) Installation ------------ @@ -99,4 +99,21 @@ Yii::$app->queue->isReserved($id); Yii::$app->queue->isDone($id); ``` -For more details see [the guide](docs/guide/README.md). +## Documentation + +- [the guide](docs/guide/README.md) + +## Support the project + +[![Open Collective](https://img.shields.io/badge/Open%20Collective-sponsor-7eadf1?style=for-the-badge&logo=open%20collective&logoColor=7eadf1&labelColor=555555)](https://opencollective.com/yiisoft) + +## Follow updates + +[![Official website](https://img.shields.io/badge/Powered_by-Yii_Framework-green.svg?style=for-the-badge&logo=yii)](https://www.yiiframework.com/) +[![Follow on X](https://img.shields.io/badge/-Follow%20on%20X-1DA1F2.svg?style=for-the-badge&logo=x&logoColor=white&labelColor=000000)](https://x.com/yiiframework) +[![Telegram](https://img.shields.io/badge/telegram-join-1DA1F2?style=for-the-badge&logo=telegram)](https://t.me/yii_framework_in_english) +[![Slack](https://img.shields.io/badge/slack-join-1DA1F2?style=for-the-badge&logo=slack)](https://yiiframework.com/go/slack) + +## License + +[![License](https://img.shields.io/badge/License-BSD--3--Clause-brightgreen.svg?style=for-the-badge&logo=opensourceinitiative&logoColor=white&labelColor=555555)](LICENSE.md) diff --git a/composer.json b/composer.json index d83e1e6ec..20a742fd6 100644 --- a/composer.json +++ b/composer.json @@ -84,7 +84,9 @@ } ], "scripts": { - "phpcbf": "./vendor/bin/phpcbf -q src/ tests/", - "phpcs": "./vendor/bin/phpcs -q src/ tests/" + "cs": "./vendor/bin/phpcs", + "cs-fix": "./vendor/bin/phpcbf", + "static": "./vendor/bin/phpstan --memory-limit=-1", + "tests": "./make test" } } diff --git a/docs/guide/README.md b/docs/guide/README.md index 0811c2dd6..c30231fe7 100644 --- a/docs/guide/README.md +++ b/docs/guide/README.md @@ -33,3 +33,4 @@ Developer tools Contributing ------------ * [Tests](tests.md) +* [Internals](internals.md) diff --git a/docs/guide/internals.md b/docs/guide/internals.md new file mode 100644 index 000000000..6e93fae6f --- /dev/null +++ b/docs/guide/internals.md @@ -0,0 +1,49 @@ +# Internals + +This package provides a consistent set of [Composer](https://getcomposer.org/) scripts for local validation. + +Tool references: + +- [PHPCodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) for code style checks. +- [PHPStan](https://phpstan.org/) for static analysis. +- [PHPUnit](https://phpunit.de/) for unit tests. + +## Code style checks (PHPCodeSniffer) + +Run code style checks. + +```bash +composer cs +``` + +Fix code style issues. + +```bash +composer cs-fix +``` + +## Static analysis (PHPStan) + +Run static analysis. + +```bash +composer static +``` + +## Unit tests (PHPUnit) + +Run the full test suite. + +```bash +composer tests +``` + +## Passing extra arguments + +Composer scripts support forwarding additional arguments using `--`. + +Run PHPStan with a different memory limit. + +```bash +composer static -- --memory-limit=512M +``` diff --git a/phpcs.xml.dist b/phpcs.xml.dist index ee986fbad..034a5e11f 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -5,6 +5,10 @@ + + src + tests + /*\.php$