diff --git a/.github/workflows/bc.yml b/.github/workflows/bc.yml index d23237d..ad2ecaa 100644 --- a/.github/workflows/bc.yml +++ b/.github/workflows/bc.yml @@ -1,21 +1,23 @@ +name: backwards compatibility + on: pull_request: - paths: + paths: &paths - 'src/**' - '.github/workflows/bc.yml' + - '.roave-backward-compatibility-check.xml' - 'composer.json' push: branches: ['master'] - paths: - - 'src/**' - - '.github/workflows/bc.yml' - - 'composer.json' - -name: backwards compatibility + paths: *paths permissions: contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: roave_bc_check: uses: yiisoft/actions/.github/workflows/bc.yml@master @@ -23,4 +25,4 @@ jobs: os: >- ['ubuntu-latest'] php: >- - ['8.4'] + ['8.5'] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 35abbae..6c2bb17 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,30 +1,24 @@ +name: build + on: pull_request: - paths-ignore: - - 'docs/**' - - 'README.md' - - 'CHANGELOG.md' - - '.gitignore' - - '.gitattributes' - - 'infection.json.dist' - - 'psalm.xml' - + paths: &paths + - 'src/**' + - 'tests/**' + - 'phpunit.xml.dist' + - 'composer.json' + - '.github/workflows/build.yml' push: branches: ['master'] - paths-ignore: - - 'docs/**' - - 'README.md' - - 'CHANGELOG.md' - - '.gitignore' - - '.gitattributes' - - 'infection.json.dist' - - 'psalm.xml' - -name: build + paths: *paths permissions: contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: phpunit: uses: yiisoft/actions/.github/workflows/phpunit.yml@master @@ -33,3 +27,5 @@ jobs: ['ubuntu-latest', 'windows-latest'] php: >- ['8.1', '8.2', '8.3', '8.4', '8.5'] + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/composer-dependency-analyser.yml b/.github/workflows/composer-dependency-analyser.yml new file mode 100644 index 0000000..3fed6a3 --- /dev/null +++ b/.github/workflows/composer-dependency-analyser.yml @@ -0,0 +1,27 @@ +name: composer dependency analyser + +on: + pull_request: + paths: &paths + - 'src/**' + - 'tests/**' + - '.github/workflows/composer-dependency-analyser.yml' + - 'composer.json' + - 'composer-dependency-analyser.php' + push: + branches: ['master'] + paths: *paths + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + composer-dependency-analyser: + uses: yiisoft/actions/.github/workflows/composer-dependency-analyser.yml@master + with: + php: >- + ['8.1', '8.2', '8.3', '8.4', '8.5'] diff --git a/.github/workflows/composer-require-checker.yml b/.github/workflows/composer-require-checker.yml deleted file mode 100644 index 1a56fef..0000000 --- a/.github/workflows/composer-require-checker.yml +++ /dev/null @@ -1,37 +0,0 @@ -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 - -permissions: - contents: read - -jobs: - composer-require-checker: - uses: yiisoft/actions/.github/workflows/composer-require-checker.yml@master - with: - os: >- - ['ubuntu-latest'] - php: >- - ['8.1', '8.2', '8.3', '8.4', '8.5'] diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml index 7534234..6ff2a77 100644 --- a/.github/workflows/zizmor.yml +++ b/.github/workflows/zizmor.yml @@ -13,6 +13,10 @@ permissions: actions: read # Required by zizmor when reading workflow metadata through the API contents: read # Required to read workflow files +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: zizmor: uses: yiisoft/actions/.github/workflows/zizmor.yml@master diff --git a/.roave-backward-compatibility-check.xml b/.roave-backward-compatibility-check.xml new file mode 100644 index 0000000..79c40f0 --- /dev/null +++ b/.roave-backward-compatibility-check.xml @@ -0,0 +1,6 @@ + + + #An enum expression .* is not supported# + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 6295dce..0e14577 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 2.0.1 under development -Enh #246: Explicitly import functions and constants in "use" section (@mspirkov) +- Enh #246: Explicitly import functions and constants in "use" section (@mspirkov) ## 2.0.0 December 13, 2025 diff --git a/composer-dependency-analyser.php b/composer-dependency-analyser.php new file mode 100644 index 0000000..5b4c026 --- /dev/null +++ b/composer-dependency-analyser.php @@ -0,0 +1,11 @@ +disableComposerAutoloadPathScan() + ->setFileExtensions(['php']) + ->addPathToScan(__DIR__ . '/src', isDev: false) + ->addPathToScan(__DIR__ . '/tests', isDev: true); diff --git a/composer.json b/composer.json index 606bd9a..c0b3fdd 100644 --- a/composer.json +++ b/composer.json @@ -36,11 +36,12 @@ "yiisoft/arrays": "^3.0" }, "require-dev": { + "ext-ctype": "*", "bamarni/composer-bin-plugin": "^1.8.3", "friendsofphp/php-cs-fixer": "^3.91.3", - "maglnet/composer-require-checker": "^4.7.1", "phpunit/phpunit": "^10.5.60", "rector/rector": "^2.2.14", + "shipmonk/composer-dependency-analyser": "^1.8", "spatie/phpunit-watcher": "^1.24" }, "autoload": { @@ -71,6 +72,7 @@ "test": "phpunit --testdox --no-interaction", "test-watch": "phpunit-watcher watch", "cs-fix": "php-cs-fixer fix", - "mutation": "infection --threads=max --min-covered-msi=100" + "mutation": "infection --threads=max --min-covered-msi=100", + "dependency-analyser": "composer-dependency-analyser" } } diff --git a/docs/internals.md b/docs/internals.md index 0a0a1cd..b77907c 100644 --- a/docs/internals.md +++ b/docs/internals.md @@ -36,9 +36,9 @@ use either newest or any specific version of PHP: ## Dependencies -This package uses [composer-require-checker](https://github.com/maglnet/ComposerRequireChecker) to check if all -dependencies are correctly defined in `composer.json`. To run the checker, execute the following command: +Use [Composer Dependency Analyser](https://github.com/shipmonk-rnd/composer-dependency-analyser) to detect unknown, +shadow, and unused [Composer](https://getcomposer.org) dependencies: ```shell -./vendor/bin/composer-require-checker +./vendor/bin/composer-dependency-analyser ```