Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/rector.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
on:
pull_request:
pull_request_target:
paths-ignore:
- 'docs/**'
- 'README.md'
Expand All @@ -17,6 +17,7 @@ jobs:
secrets:
token: ${{ secrets.YIISOFT_GITHUB_TOKEN }}
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
os: >-
['ubuntu-latest']
php: >-
Expand Down
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@ export COMPOSE_PROJECT_NAME=yii-queue-amqp
help: ## Display help information
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'

build: ## Build an image from a docker-compose file. Params: {{ v=8.1 }}. Default latest PHP 8.1
docker-compose -f tests/docker-compose.yml up -d --build
build: ## Build an image from a docker-compose file. Params: {{ v=81 }}
docker compose -f tests/docker-compose.yml up -d --build

down: ## Stop and remove containers, networks
docker-compose -f tests/docker-compose.yml down
docker compose -f tests/docker-compose.yml down

test: ## Run tests. Params: {{ v=8.1 }}. Default latest PHP 8.1
docker-compose -f tests/docker-compose.yml build --pull php$(v)
docker-compose -f tests/docker-compose.yml run php$(v) vendor/bin/phpunit --debug
test: ## Run tests. Params: {{ v=81 }}
docker compose -f tests/docker-compose.yml build --pull php$(v)
docker compose -f tests/docker-compose.yml run php$(v) vendor/bin/phpunit --debug
make down

sh: ## Enter the container with the application
docker-compose -f tests/docker-compose.yml run php$(v)
docker compose -f tests/docker-compose.yml run php$(v)

mutation-test: ## Run mutation tests. Params: {{ v=8.1 }}. Default latest PHP 8.1
docker-compose -f tests/docker-compose.yml build --pull php$(v)
docker-compose -f tests/docker-compose.yml run php$(v) php -dpcov.enabled=1 -dpcov.directory=. vendor/bin/roave-infection-static-analysis-plugin -j2 --ignore-msi-with-no-mutations --only-covered
mutation-test: ## Run mutation tests. Params: {{ v=81 }}
docker compose -f tests/docker-compose.yml build --pull php$(v)
docker compose -f tests/docker-compose.yml run php$(v) php -dpcov.enabled=1 -dpcov.directory=. vendor/bin/roave-infection-static-analysis-plugin -j2 --ignore-msi-with-no-mutations --only-covered
make down

coverage: ## Run code coverage. Params: {{ v=8.1 }}. Default latest PHP 8.1
coverage: ## Run code coverage. Params: {{ v=81 }}
docker-compose -f tests/docker-compose.yml run php$(v) vendor/bin/phpunit --coverage-clover coverage.xml
make down

static-analyze: ## Run code static analyze. Params: {{ v=8.1 }}. Default latest PHP 8.1
docker-compose -f tests/docker-compose.yml run php$(v) vendor/bin/psalm --config=psalm.xml --shepherd --stats --php-version=8.1
static-analyze: ## Run code static analyze. Params: {{ v=81 }}
docker compose -f tests/docker-compose.yml run php$(v) vendor/bin/psalm --config=psalm.xml --shepherd --stats --php-version=8.1
make down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
"infection/infection": "^0.27.8||^0.29.0",
"maglnet/composer-require-checker": "^4.4",
"phpunit/phpunit": "^9.5",
"rector/rector": "^1.0",
"rector/rector": "^2.0.15",
"roave/infection-static-analysis-plugin": "^1.16",
"spatie/phpunit-watcher": "^1.23",
"symfony/console": "^6.0",
"symfony/process": "^6.0",
"vimeo/psalm": "^5.20||^6.0",
"vimeo/psalm": "^5.26.1 || ^6.10.3",
"yiisoft/test-support": "^3.0"
},
"autoload": {
Expand Down
2 changes: 2 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
errorLevel="1"
findUnusedBaselineEntry="true"
findUnusedCode="false"
ensureOverrideAttribute="false"
strictBinaryOperands="false"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
Expand Down
25 changes: 8 additions & 17 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,23 @@

use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
return RectorConfig::configure()
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
]);

// register a single rule
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);

// define sets of rules
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_81,
]);

$rectorConfig->skip([
])
->withPhpSets(php81: true)
->withRules([
InlineConstructorDefaultToPropertyRector::class,
])
->withSkip([
ClosureToArrowFunctionRector::class,
JsonThrowOnErrorRector::class,
ReadOnlyPropertyRector::class,
NullToStrictStringFuncCallArgRector::class,
ReturnNeverTypeRector::class,
]);
};
4 changes: 1 addition & 3 deletions src/Exception/ExchangeDeclaredException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
use InvalidArgumentException;
use Yiisoft\FriendlyException\FriendlyExceptionInterface;

class ExchangeDeclaredException extends InvalidArgumentException implements FriendlyExceptionInterface
final class ExchangeDeclaredException extends InvalidArgumentException implements FriendlyExceptionInterface
{
protected $message = 'Can\'t set channel name implicitly when an exchange is declared';

public function getName(): string
{
return 'Exchange is declared';
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/NotImplementedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

use RuntimeException;

class NotImplementedException extends RuntimeException
final class NotImplementedException extends RuntimeException
{
}
2 changes: 0 additions & 2 deletions tests/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.5"

x-php: &php
volumes:
- ./runtime:/app/tests/runtime
Expand Down
Loading