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,12 +1,13 @@
name: Composer require checker
name: composer dependency analyser

on:
pull_request:
paths: &paths
- '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 @@ -19,10 +20,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']
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 1.1.1 under development

- Enh #91: Remove unused `ext-pdo` and `psr/log` dependencies (@vjik)
- Enh #78: Explicitly import classes in "use" section (@mspirkov)

## 1.1.0 December 16, 2025
Expand Down
15 changes: 15 additions & 0 deletions composer-dependency-analyser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?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)
// Per-DBMS driver packages (yiisoft/db-mysql, db-pgsql, ...) are intentionally not required anywhere in
// composer.json: each CI job (see .github/workflows/{mysql,pgsql,mssql,oracle,sqlite}.yml) installs only the
// one it needs via a separate `composer require` step before running that DBMS's test suite.
->ignoreUnknownClassesRegex('#^Yiisoft\\\\Db\\\\(Mssql|Mysql|Oracle|Pgsql|Sqlite)\\\\#');
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@
],
"require": {
"php": "^8.1",
"ext-pdo": "*",
"psr/log": "^3.0",
"yiisoft/db": "^1.0",
"yiisoft/log": "^2.2"
},
"require-dev": {
"ext-pdo": "*",
"friendsofphp/php-cs-fixer": "^3.93",
"maglnet/composer-require-checker": "^4.2",
"phpunit/phpunit": "^9.6|^10.1",
"psr/log": "^3.0",
"rector/rector": "^2.0.3",
"roave/infection-static-analysis-plugin": "^1.25|^1.29",
"shipmonk/composer-dependency-analyser": "^1.8",
"spatie/phpunit-watcher": "^1.23",
"vimeo/psalm": "^5.8|^6.13.1",
"yiisoft/cache": "^3.0",
Expand All @@ -64,6 +64,7 @@
}
},
"scripts": {
"dependency-analyser": "composer-dependency-analyser",
"test": "phpunit --testdox --no-interaction",
"test-watch": "phpunit-watcher watch",
"cs-fix": "php-cs-fixer fix"
Expand Down
6 changes: 3 additions & 3 deletions docs/internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ use either newest or any specific version of PHP:

## Dependencies

Use [ComposerRequireChecker](https://github.com/maglnet/ComposerRequireChecker) to detect transitive
[Composer](https://getcomposer.org) dependencies. 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