Skip to content

Commit 6b5c4e9

Browse files
committed
feat: integrate composer-dependency-analyser for dependency analysis
Signed-off-by: mmalac <[email protected]>
1 parent 4bdb7e1 commit 6b5c4e9

File tree

6 files changed

+144
-355
lines changed

6 files changed

+144
-355
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
/.laminas-ci.json export-ignore
1212
/composer.lock export-ignore
1313
/renovate.json export-ignore
14+
/composer-dependency-analyser.php export-ignore

.github/workflows/continuous-integration.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ on:
66
branches:
77
tags:
88

9+
env:
10+
default_php: 8.2
11+
912
jobs:
1013
ci:
1114
uses: laminas/workflow-continuous-integration/.github/workflows/[email protected]
15+
16+
dep-analyser:
17+
runs-on: ubuntu-latest
18+
name: Run Dependency analysis
19+
steps:
20+
- uses: actions/[email protected]
21+
- uses: shivammathur/[email protected]
22+
with:
23+
php-version: ${{ env.default_php }}
24+
extensions: swoole
25+
tools: composer
26+
- uses: ramsey/composer-install@v3
27+
- run: composer dep-analysis

composer-dependency-analyser.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use ShipMonk\ComposerDependencyAnalyser\Config\Configuration;
6+
7+
$config = new Configuration();
8+
return $config
9+
// Ignore unknown classes for PHP 8.2 compatibility. Remove after dropping PHP 8.2 support.
10+
->ignoreUnknownClasses([Override::class])
11+
->ignoreUnknownFunctions(["inotify_add_watch", "inotify_init", "inotify_read"]);

composer.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,25 @@
3939
"ext-swoole": "^6.0",
4040
"ext-zlib": "*",
4141
"dflydev/fig-cookies": "^2.0.1 || ^3.0",
42-
"laminas/laminas-cli": "^1.8",
42+
"filp/whoops": "^2.18",
4343
"laminas/laminas-diactoros": "^2.25.2 || ^3.0",
4444
"laminas/laminas-httphandlerrunner": "^2.5",
4545
"mezzio/mezzio": "^3.15",
4646
"psr/container": "^1.1.2 || ^2.0.2",
4747
"psr/event-dispatcher": "^1.0",
4848
"psr/http-message": "^1.1 || ^2.0",
49-
"psr/http-message-implementation": "^1.0 || ^2.0",
5049
"psr/http-server-handler": "^1.0.2",
5150
"psr/log": "^1.0 || ^2.0 || ^3.0",
5251
"symfony/console": "^5.3 || ^6.0.19 || ^7.0",
5352
"webmozart/assert": "^1.11"
5453
},
5554
"require-dev": {
56-
"filp/whoops": "^2.15.2",
5755
"laminas/laminas-coding-standard": "~3.1.0",
5856
"laminas/laminas-servicemanager": "^4.0",
57+
"laminas/laminas-stdlib": "^3.20",
5958
"phpunit/phpunit": "^10.5",
6059
"psalm/plugin-phpunit": "^0.19.5",
60+
"shipmonk/composer-dependency-analyser": "^1.8",
6161
"swoole/ide-helper": "^6.0",
6262
"vimeo/psalm": "^6.13"
6363
},
@@ -77,10 +77,12 @@
7777
"scripts": {
7878
"check": [
7979
"@cs-check",
80-
"@test"
80+
"@test",
81+
"@dep-analysis"
8182
],
8283
"cs-check": "phpcs",
8384
"cs-fix": "phpcbf",
85+
"dep-analysis": "composer-dependency-analyser --disable-ext-analysis",
8486
"static-analysis": "psalm --shepherd --stats",
8587
"test": "phpunit --colors=always",
8688
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml"

0 commit comments

Comments
 (0)