diff --git a/.github/workflows/composer-require-checker.yml b/.github/workflows/composer-require-checker.yml new file mode 100644 index 0000000..825dbd9 --- /dev/null +++ b/.github/workflows/composer-require-checker.yml @@ -0,0 +1,35 @@ +on: + pull_request: + paths-ignore: + - 'docs/**' + - 'README.md' + - 'CHANGELOG.md' + - '.gitignore' + - '.gitattributes' + - 'infection.json.dist' + - 'phpunit.xml.dist' + - 'psalm.xml' + + push: + branches: ['master'] + paths-ignore: + - 'docs/**' + - 'README.md' + - 'CHANGELOG.md' + - '.gitignore' + - '.gitattributes' + - 'infection.json.dist' + - 'phpunit.xml.dist' + - 'psalm.xml' + +name: Composer require checker + +jobs: + composer-require-checker: + uses: yiisoft/actions/.github/workflows/composer-require-checker.yml@master + with: + os: >- + ['ubuntu-latest'] + php: >- + ['8.3'] + extensions: uopz diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml new file mode 100644 index 0000000..6a2162d --- /dev/null +++ b/.github/workflows/rector.yml @@ -0,0 +1,22 @@ +on: + pull_request: + paths-ignore: + - 'docs/**' + - 'README.md' + - 'CHANGELOG.md' + - '.gitignore' + - '.gitattributes' + - 'infection.json.dist' + - 'psalm.xml' + +name: rector + +jobs: + rector: + uses: yiisoft/actions/.github/workflows/rector.yml@master + with: + os: >- + ['ubuntu-latest'] + php: >- + ['8.3'] + extensions: uopz diff --git a/composer.json b/composer.json index 569c9b7..0e8d754 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,9 @@ }, "require-dev": { "ext-uopz": "*", + "maglnet/composer-require-checker": "^4.9", "phpunit/phpunit": "^10.5.2", + "rector/rector": "^1.0.0", "psr/log": "^1.1.3", "roave/infection-static-analysis-plugin": "^1.18", "slope-it/clock-mock": "0.4.0", diff --git a/rector.php b/rector.php new file mode 100644 index 0000000..f55daae --- /dev/null +++ b/rector.php @@ -0,0 +1,27 @@ +paths([ + __DIR__ . '/src', + __DIR__ . '/tests', + ]); + + // register a single rule + $rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class); + + // define sets of rules + $rectorConfig->sets([ + LevelSetList::UP_TO_PHP_80, + ]); + + $rectorConfig->skip([ + ClosureToArrowFunctionRector::class, + ]); +};