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
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
- 'config/**'
- 'src/**'
- '.github/workflows/composer-require-checker.yml'
- 'tests/**'
- '.github/workflows/composer-dependency-analyser.yml'
- 'composer.json'
- 'composer-require-checker.json'
- 'composer-dependency-analyser.php'
push:
branches: ['master']
paths: *paths
Expand All @@ -20,11 +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']
config: ./composer-require-checker.json
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__ . '/tests', isDev: true)
// Optional PHP extensions used by specific rules only, declared in "suggest".
->ignoreErrorsOnExtensions(['ext-fileinfo', 'ext-intl'], [ErrorType::SHADOW_DEPENDENCY])
// Optional integrations used conditionally (class_exists()/attributes), intentionally kept as dev dependencies.
->ignoreErrorsOnPackages(
['jetbrains/phpstorm-attributes', 'yiisoft/translator-message-php', 'yiisoft/yii-debug'],
[ErrorType::DEV_DEPENDENCY_IN_PROD],
);
23 changes: 0 additions & 23 deletions composer-require-checker.json

This file was deleted.

6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.3",
"friendsofphp/php-cs-fixer": "^3.91",
"guzzlehttp/psr7": "^2.13",
"jetbrains/phpstorm-attributes": "^1.2",
"maglnet/composer-require-checker": "^4.7.1",
"phpbench/phpbench": "^1.4.1",
"phpunit/phpunit": "^10.5.46",
"rector/rector": "^2.0.16",
"shipmonk/composer-dependency-analyser": "^1.8",
"spatie/phpunit-watcher": "^1.24",
"yiisoft/di": "^1.3",
"yiisoft/test-support": "^3.0.2",
Expand Down Expand Up @@ -95,6 +96,7 @@
"infection": "vendor/bin/infection",
"dry-run": "vendor/bin/rector process --dry-run",
"psalm": "vendor/bin/psalm --config=psalm.xml",
"cs-fix": "php-cs-fixer fix"
"cs-fix": "php-cs-fixer fix",
"dependency-analyser": "composer-dependency-analyser"
}
}
8 changes: 6 additions & 2 deletions docs/internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ 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.
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-dependency-analyser
```

## Translation

Expand Down
Loading