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

on:
pull_request:
Expand All @@ -7,9 +7,9 @@ on:
- 'src/**'
- 'templates/**'
- 'tests/**'
- '.github/workflows/composer-require-checker.yml'
- '.github/workflows/composer-dependency-analyser.yml'
- 'composer.json'
- 'composer-require-checker.json'
- 'composer-dependency-analyser.php'
push:
branches: ['master']
paths: *paths
Expand All @@ -22,10 +22,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']
20 changes: 20 additions & 0 deletions composer-dependency-analyser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

use ShipMonk\ComposerDependencyAnalyser\Config\Configuration;
use ShipMonk\ComposerDependencyAnalyser\Config\ErrorType;

return (new Configuration())
->disableComposerAutoloadPathScan()
->setFileExtensions(['php'])
->addPathToScan(__DIR__ . '/config', isDev: false)
->addPathToScan(__DIR__ . '/src', isDev: false)
->addPathToScan(__DIR__ . '/templates', isDev: false)
->addPathToScan(__DIR__ . '/tests', isDev: true)
// `psr/event-dispatcher` is an intentionally optional integration: `ErrorHandler` only accepts it
// via a nullable constructor type-hint, consumers are not required to install it.
->ignoreErrorsOnPackages(['psr/event-dispatcher'], [ErrorType::DEV_DEPENDENCY_IN_PROD])
// `yiisoft/definitions` is used only in `config/di-web.php`, which is loaded by consumers using
// `yiisoft/di`, that already requires `yiisoft/definitions` itself.
->ignoreErrorsOnPackages(['yiisoft/definitions'], [ErrorType::SHADOW_DEPENDENCY]);
17 changes: 0 additions & 17 deletions composer-require-checker.json

This file was deleted.

9 changes: 2 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.92.5",
"bamarni/composer-bin-plugin": "^1.8.2",
"httpsoft/http-message": "^1.1.6",
"phpunit/phpunit": "^10.5.51",
"psr/event-dispatcher": "^1.0",
"rector/rector": "^2.1.3",
"roave/infection-static-analysis-plugin": "^1.35",
"shipmonk/composer-dependency-analyser": "^1.8",
"spatie/phpunit-watcher": "^1.24",
"vimeo/psalm": "^5.26.1 || ^6.13.1",
"yiisoft/di": "^1.4",
Expand All @@ -69,11 +69,6 @@
}
},
"extra": {
"bamarni-bin": {
"bin-links": true,
"target-directory": "tools",
"forward-command": true
},
"config-plugin-options": {
"source-directory": "config"
},
Expand All @@ -84,12 +79,12 @@
"config": {
"sort-packages": true,
"allow-plugins": {
"bamarni/composer-bin-plugin": true,
"composer/package-versions-deprecated": true,
"infection/extension-installer": true
}
},
"scripts": {
"dependency-analyser": "composer-dependency-analyser",
"test": "phpunit --testdox --no-interaction",
"test-watch": "phpunit-watcher watch"
}
Expand Down
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
```
2 changes: 0 additions & 2 deletions tools/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions tools/composer-require-checker/composer.json

This file was deleted.

Loading