Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: Composer require checker
name: composer dependency analyser

on:
pull_request:
paths: &paths
- 'migrations/**'
- 'src/**'
- 'tests/**'
- '.github/workflows/composer-dependency-analyser.yml'
- 'composer.json'
- '.github/workflows/composer-require-checker.yml'
- 'composer-dependency-analyser.php'
push:
branches: ['master']
paths: *paths
Expand All @@ -20,10 +21,8 @@ concurrency:
cancel-in-progress: true

jobs:
composer-require-checker:
uses: yiisoft/actions/.github/workflows/composer-require-checker.yml@master
composer-dependency-analyser:
uses: yiisoft/actions/.github/workflows/composer-dependency-analyser.yml@master
with:
os: >-
['ubuntu-latest']
php: >-
['8.1', '8.2', '8.3', '8.4', '8.5']
18 changes: 18 additions & 0 deletions composer-dependency-analyser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

use ShipMonk\ComposerDependencyAnalyser\Config\Configuration;

return (new Configuration())
->disableComposerAutoloadPathScan()
->setFileExtensions(['php'])
->addPathToScan(__DIR__ . '/src', isDev: false)
->addPathToScan(__DIR__ . '/migrations', isDev: false)
->addPathToScan(__DIR__ . '/tests', isDev: true)
// yiisoft/db-migration is an optional integration (see composer.json "suggest"), not a hard dependency.
->ignoreUnknownClasses([
'Yiisoft\Db\Migration\MigrationBuilder',
'Yiisoft\Db\Migration\RevertibleMigrationInterface',
'Yiisoft\Db\Migration\TransactionalMigrationInterface',
]);
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.95",
"maglnet/composer-require-checker": "^4.7",
"phpunit/phpunit": "^10.5",
"rector/rector": "^2.0.3",
"roave/infection-static-analysis-plugin": "^1.34",
"shipmonk/composer-dependency-analyser": "^1.8",
"spatie/phpunit-watcher": "^1.23",
"vimeo/psalm": "^5.26.1 || ^6.16.1",
"yiisoft/cache": "^3.2",
Expand Down Expand Up @@ -82,6 +82,7 @@
"test": "phpunit --testdox",
"test-watch": "phpunit-watcher watch",
"rector": "rector",
"cs-fix": "php-cs-fixer fix"
"cs-fix": "php-cs-fixer fix",
"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