Skip to content

Commit

Permalink
Enhancement: Add ComposerRequireChecker (#1513)
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarStark committed Sep 20, 2023
1 parent 8134c7a commit 3da6d2a
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,7 @@ jobs:
-
name: "Check for unused dependencies"
run: 'vendor/bin/composer-unused --no-progress --output-format=github | grep -e "^::error" && exit 1 || :'

-
name: "Check for implicit dependencies"
run: "tools/composer-require-checker check --config-file=$(pwd)/composer-require-checker.json composer.json"
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ refactoring:
vendor/bin/rector process --config rector.php

.PHONY: dependency-analysis
dependency-analysis:
dependency-analysis: vendor ## Runs a dependency analysis with maglnet/composer-require-checker
symfony php tools/composer-require-checker check --config-file=$(shell pwd)/composer-require-checker.json
vendor/bin/composer-unused
22 changes: 22 additions & 0 deletions composer-require-checker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"symbol-whitelist": [
"array",
"bool",
"callable",
"dump",
"false",
"float",
"int",
"iterable",
"mixed",
"null",
"object",
"parent",
"self",
"static",
"string",
"true",
"void",
"never"
]
}
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
"php": "^8.2",
"ext-ctype": "*",
"ext-iconv": "*",
"ext-mbstring": "*",
"composer/semver": "^3.4.0",
"ondram/ci-detector": "^4.1.0",
"symfony/config": "^6.3.2",
"symfony/console": "^6.3.4",
"symfony/dependency-injection": "^6.3.4",
"symfony/finder": "^6.3.3",
"symfony/options-resolver": "^6.3.0",
"symfony/service-contracts": "^3.3",
"symfony/string": "^6.3.2",
"symfony/yaml": "^6.3.3",
"webmozart/assert": "^1.11"
Expand Down
5 changes: 3 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions phive.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="composer-require-checker" version="^4.0" installed="4.7.0" location="./tools/composer-require-checker" copy="true"/>
</phive>
Binary file added tools/composer-require-checker
Binary file not shown.

0 comments on commit 3da6d2a

Please sign in to comment.