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
27 changes: 27 additions & 0 deletions .github/workflows/composer-dependency-analyser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: composer dependency analyser

on:
pull_request:
paths: &paths
- 'src/**'
- 'tests/**'
- '.github/workflows/composer-dependency-analyser.yml'
- 'composer.json'
- 'composer-dependency-analyser.php'
push:
branches: ['master']
paths: *paths

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

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

declare(strict_types=1);

use ShipMonk\ComposerDependencyAnalyser\Config\Configuration;

return (new Configuration())
->disableComposerAutoloadPathScan()
->setFileExtensions(['php'])
->addPathToScan(__DIR__ . '/src', false)
->addPathToScan(__DIR__ . '/tests', true);
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"phpunit/phpunit": "^9.6.35",
"rector/rector": "^2.5",
"roave/infection-static-analysis-plugin": "^1.16",
"shipmonk/composer-dependency-analyser": "^1.8",
"spatie/phpunit-watcher": "^1.23",
"vimeo/psalm": "^4.30 || ^5.26.1 || ^6.16.1",
"yiisoft/code-style": "^1.1"
Expand All @@ -59,6 +60,7 @@
},
"scripts": {
"cs-fix": "php-cs-fixer fix",
"dependency-analyser": "composer-dependency-analyser",
"psalm": "psalm",
"rector": "rector",
"test": "phpunit --testdox --no-interaction",
Expand Down
9 changes: 9 additions & 0 deletions docs/internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,12 @@ The code is statically analyzed with [Psalm](https://psalm.dev/). To run static
```shell
./vendor/bin/psalm
```

## 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
```
Loading