Skip to content
Draft
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
27 changes: 27 additions & 0 deletions .github/workflows/composer-dependency-analyser.yml
Original file line number Diff line number Diff line change
@@ -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']
37 changes: 0 additions & 37 deletions .github/workflows/composer-require-checker.yml

This file was deleted.

11 changes: 11 additions & 0 deletions composer-dependency-analyser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

use ShipMonk\ComposerDependencyAnalyser\Config\Configuration;

return (new Configuration())
->disableComposerAutoloadPathScan()
->setFileExtensions(['php'])
->addPathToScan(__DIR__ . '/src', isDev: false)
->addPathToScan(__DIR__ . '/tests', isDev: true);
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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"
}
}
6 changes: 3 additions & 3 deletions docs/internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Loading