diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index a2f08c0..2d65ded 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -23,20 +23,10 @@ jobs: name: Install dependencies run: composer install --no-progress --prefer-dist --no-interaction - - - name: Install extra tools - run: | - wget https://github.com/composer-unused/composer-unused/releases/latest/download/composer-unused.phar - wget https://github.com/maglnet/ComposerRequireChecker/releases/download/4.5.0/composer-require-checker.phar - name: Run checks run: composer check - - - name: Check unused dependencies - run: php composer-unused.phar --output-format=default - - - name: Check shadow dependencies - run: php composer-require-checker.phar check composer.json + tests: runs-on: ubuntu-latest diff --git a/composer.json b/composer.json index f10af9d..fc38468 100644 --- a/composer.json +++ b/composer.json @@ -18,6 +18,7 @@ "phpstan/phpstan-phpunit": "^1.3.3", "phpstan/phpstan-strict-rules": "^1.4.5", "phpunit/phpunit": "^9.5.28", + "shipmonk/composer-dependency-analyser": "^1.0", "shipmonk/phpstan-rules": "^2.2.0", "slevomat/coding-standard": "^8.8.0" }, @@ -45,10 +46,15 @@ "@check:ec", "@check:cs", "@check:types", - "@check:tests" + "@check:tests", + "@check:dependencies" ], "check:composer": "composer normalize --dry-run --no-check-lock --no-update-lock", "check:cs": "phpcs", + "check:dependencies": [ + "composer dump-autoload --classmap-authoritative", + "composer-dependency-analyser" + ], "check:ec": "ec src", "check:tests": "phpunit -vvv tests", "check:types": "phpstan analyse -vvv", diff --git a/composer.lock b/composer.lock index 9b4f1e2..fdf27e8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c2ba195fbdd7979dbe0ede954f27c049", + "content-hash": "f49d791ec6b64ce6b8bb02ad09f3659a", "packages": [ { "name": "doctrine/cache", @@ -4509,6 +4509,68 @@ ], "time": "2020-09-28T06:39:44+00:00" }, + { + "name": "shipmonk/composer-dependency-analyser", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/shipmonk-rnd/composer-dependency-analyser.git", + "reference": "58da2ff17fcb82d363d906e9db668b5ddeb82222" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/shipmonk-rnd/composer-dependency-analyser/zipball/58da2ff17fcb82d363d906e9db668b5ddeb82222", + "reference": "58da2ff17fcb82d363d906e9db668b5ddeb82222", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "editorconfig-checker/editorconfig-checker": "^10.3.0", + "ergebnis/composer-normalize": "^2.19", + "phpstan/phpstan": "^1.10.30", + "phpstan/phpstan-phpunit": "^1.1.1", + "phpstan/phpstan-strict-rules": "^1.2.3", + "phpunit/phpunit": "^8.5.28 || ^9.5.20", + "shipmonk/name-collision-detector": "^2.0.0", + "slevomat/coding-standard": "^8.0.1" + }, + "bin": [ + "bin/composer-dependency-analyser" + ], + "type": "library", + "autoload": { + "psr-4": { + "ShipMonk\\ComposerDependencyAnalyser\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Fast detection of composer dependency issues (dead dependencies, shadow dependencies, misplaced dependencies)", + "keywords": [ + "analyser", + "composer", + "composer dependency", + "dead code", + "dead dependency", + "detector", + "dev", + "misplaced dependency", + "shadow dependency", + "static analysis", + "unused code", + "unused dependency" + ], + "support": { + "issues": "https://github.com/shipmonk-rnd/composer-dependency-analyser/issues", + "source": "https://github.com/shipmonk-rnd/composer-dependency-analyser/tree/1.0.0" + }, + "time": "2024-01-17T13:41:26+00:00" + }, { "name": "shipmonk/phpstan-rules", "version": "2.11.2",