diff --git a/Makefile b/Makefile index 8518ae3..57b503d 100644 --- a/Makefile +++ b/Makefile @@ -12,17 +12,21 @@ composer-install: ## install php packages phpunit: ## Run phpunit php ./vendor/bin/phpunit --colors=always -.PHONY: php-cs-fixer -php-cs-fixer: ## Run php-cs-fixer - php ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --diff --dry-run --verbose - -.PHONY: php-cs-fixer-check -php-cs-fixer-check: ## Run php-cs-fixer-check +.PHONY: cs-fix +cs-fix: ## Run php-cs-fixer php ./vendor/bin/php-cs-fixer fix --dry-run +.PHONY: cs-fix-check +cs-fix-check: ## Run php-cs-fixer-check + php ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --diff --dry-run --verbose + .PHONY: phpstan phpstan: ## Run phpstan php ./vendor/bin/phpstan -.PHONY: code-quality -code-quality: php-cs-fixer-check phpunit phpstan ## Run code quality checks \ No newline at end of file +.PHONY: rector +rector: ## Run phpstan + php ./vendor/bin/rector --dry-run + +.PHONY: test +test: cs-fix-check rector phpunit phpstan ## Run code quality tests \ No newline at end of file diff --git a/composer.json b/composer.json index 2dfba8c..e12a407 100644 --- a/composer.json +++ b/composer.json @@ -23,6 +23,7 @@ "require-dev": { "phpunit/phpunit": "^9", "friendsofphp/php-cs-fixer": "^3.64", - "phpstan/phpstan": "^1.12" + "phpstan/phpstan": "^1.12", + "rector/rector": "^1.2.8" } } diff --git a/rector.php b/rector.php new file mode 100644 index 0000000..e8a107c --- /dev/null +++ b/rector.php @@ -0,0 +1,24 @@ +withPaths([ + __DIR__.'/src', + __DIR__.'/tests', + ]) + ->withSkip([ + AddOverrideAttributeToOverriddenMethodsRector::class, + ]) + ->withPreparedSets( + deadCode: true, + codeQuality: true, + typeDeclarations: true, + privatization: true, + earlyReturn: true, + strictBooleans: true, + ) + ->withPhpSets(); \ No newline at end of file