Skip to content

Commit 356209b

Browse files
Joseph Edmondsclaude
andcommitted
fix: rewrite PHAR tool stubs to only suggest QA pipeline usage
Stubs previously showed misleading "not installed as a standalone binary" error and suggested running PHARs directly, which defeats the purpose of consistent configuration managed by php-qa-ci. Now each stub: - Resolves the project's bin-dir relative to project root - Shows only `qa -t <tool>` commands with correct tool names - Includes `-p` path examples only for tools that support it - No mention of running PHARs directly Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7b0122e commit 356209b

4 files changed

Lines changed: 39 additions & 32 deletions

File tree

bin/composer-require-checker

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/usr/bin/env bash
2-
echo "ERROR: composer-require-checker is not installed as a standalone binary."
2+
# Find project root by walking up to composer.json
3+
projectRoot="$COMPOSER_RUNTIME_BIN_DIR"
4+
while [[ ! -f "$projectRoot/composer.json" && "$projectRoot" != "/" ]]; do
5+
projectRoot="$(dirname "$projectRoot")"
6+
done
7+
# Make bin dir relative to project root
8+
qaCmd="${COMPOSER_RUNTIME_BIN_DIR#"$projectRoot/"}/qa"
9+
echo "Composer Require Checker is managed by php-qa-ci. Run it via the QA pipeline:"
310
echo ""
4-
echo "php-qa-ci manages Composer Require Checker as a PHAR in vendor-phar/composer-require-checker.phar"
5-
echo ""
6-
echo "To run via the QA pipeline (recommended):"
7-
echo " vendor/bin/qa -t composerRequireChecker"
8-
echo ""
9-
echo "To run directly with custom arguments:"
10-
echo " php vendor/lts/php-qa-ci/vendor-phar/composer-require-checker.phar check [args]"
11+
echo " $qaCmd -t cr # check all dependencies"
1112
exit 1

bin/infection

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/usr/bin/env bash
2-
echo "ERROR: infection is not installed as a standalone binary."
2+
# Find project root by walking up to composer.json
3+
projectRoot="$COMPOSER_RUNTIME_BIN_DIR"
4+
while [[ ! -f "$projectRoot/composer.json" && "$projectRoot" != "/" ]]; do
5+
projectRoot="$(dirname "$projectRoot")"
6+
done
7+
# Make bin dir relative to project root
8+
qaCmd="${COMPOSER_RUNTIME_BIN_DIR#"$projectRoot/"}/qa"
9+
echo "Infection is managed by php-qa-ci. Run it via the QA pipeline:"
310
echo ""
4-
echo "php-qa-ci manages Infection as a PHAR in vendor-phar/infection.phar"
5-
echo ""
6-
echo "To run via the QA pipeline (recommended):"
7-
echo " vendor/bin/qa -t infection"
8-
echo ""
9-
echo "To run directly with custom arguments:"
10-
echo " php vendor/lts/php-qa-ci/vendor-phar/infection.phar [args]"
11+
echo " $qaCmd -t infection # run mutation testing"
1112
exit 1

bin/php-cs-fixer

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#!/usr/bin/env bash
2-
echo "ERROR: php-cs-fixer is not installed as a standalone binary."
2+
# Find project root by walking up to composer.json
3+
projectRoot="$COMPOSER_RUNTIME_BIN_DIR"
4+
while [[ ! -f "$projectRoot/composer.json" && "$projectRoot" != "/" ]]; do
5+
projectRoot="$(dirname "$projectRoot")"
6+
done
7+
# Make bin dir relative to project root
8+
qaCmd="${COMPOSER_RUNTIME_BIN_DIR#"$projectRoot/"}/qa"
9+
echo "PHP CS Fixer is managed by php-qa-ci. Run it via the QA pipeline:"
310
echo ""
4-
echo "php-qa-ci manages PHP CS Fixer as a PHAR in vendor-phar/php-cs-fixer.phar"
5-
echo ""
6-
echo "To run via the QA pipeline (recommended):"
7-
echo " vendor/bin/qa -t phpCsFixer"
8-
echo ""
9-
echo "To run directly with custom arguments:"
10-
echo " php vendor/lts/php-qa-ci/vendor-phar/php-cs-fixer.phar fix [args]"
11+
echo " $qaCmd -t fixer # fix full codebase"
12+
echo " $qaCmd -t fixer -p src/Controller # fix specific path"
1113
exit 1

bin/phpstan

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
#!/usr/bin/env bash
2-
echo "ERROR: phpstan is not installed as a standalone binary."
2+
# Find project root by walking up to composer.json
3+
projectRoot="$COMPOSER_RUNTIME_BIN_DIR"
4+
while [[ ! -f "$projectRoot/composer.json" && "$projectRoot" != "/" ]]; do
5+
projectRoot="$(dirname "$projectRoot")"
6+
done
7+
# Make bin dir relative to project root
8+
qaCmd="${COMPOSER_RUNTIME_BIN_DIR#"$projectRoot/"}/qa"
9+
echo "PHPStan is managed by php-qa-ci. Run it via the QA pipeline:"
310
echo ""
4-
echo "php-qa-ci manages PHPStan as a PHAR in vendor-phar/phpstan.phar"
5-
echo ""
6-
echo "To run via the QA pipeline (recommended):"
7-
echo " vendor/bin/qa -t phpstan"
8-
echo ""
9-
echo "To run directly with custom arguments:"
10-
echo " php vendor/lts/php-qa-ci/vendor-phar/phpstan.phar analyse [args]"
11+
echo " $qaCmd -t phpstan # analyse full codebase"
12+
echo " $qaCmd -t phpstan -p src/Service # analyse specific path"
13+
echo " $qaCmd -t phpstan -p src/Entity # analyse specific folder"
1114
exit 1

0 commit comments

Comments
 (0)