Skip to content

Commit ab36baa

Browse files
LTSCommerceclaude
andcommitted
feat: add stub scripts for PHAR-wrapped tools
When php-qa-ci manages tools as PHARs (phpstan, php-cs-fixer, infection, composer-require-checker), users naturally try vendor/bin/toolname and get a confusing "Could not open input file" error. These stubs provide clear instructions on how to run via the QA pipeline or directly via PHAR. Also removes stale @phpstan-ignore annotations that are no longer needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3f4afe6 commit ab36baa

8 files changed

Lines changed: 55 additions & 5 deletions

File tree

.gitignore

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33
**/var/
44
/vendor/
55
/bin/*
6-
!/bin/qa
6+
!/bin/composer-require-checker
7+
!/bin/infection
78
!/bin/mdlinks
8-
!/bin/psr4-validate
9-
!/bin/phpunit-runfailed-filter
9+
!/bin/php-cs-fixer
10+
!/bin/phpstan
1011
!/bin/phpunit-check-annotation
12+
!/bin/phpunit-runfailed-filter
13+
!/bin/psr4-validate
14+
!/bin/qa
1115
/cache/
1216
/.phive-home/
1317
/tools/rector/vendor/

bin/composer-require-checker

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
echo "ERROR: composer-require-checker is not installed as a standalone binary."
3+
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+
exit 1

bin/infection

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
echo "ERROR: infection is not installed as a standalone binary."
3+
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+
exit 1

bin/php-cs-fixer

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
echo "ERROR: php-cs-fixer is not installed as a standalone binary."
3+
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+
exit 1

bin/phpstan

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
echo "ERROR: phpstan is not installed as a standalone binary."
3+
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+
exit 1

composer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@
5353
}
5454
},
5555
"bin": [
56+
"bin/composer-require-checker",
57+
"bin/infection",
5658
"bin/mdlinks",
59+
"bin/php-cs-fixer",
60+
"bin/phpstan",
5761
"bin/phpunit-check-annotation",
5862
"bin/psr4-validate",
5963
"bin/qa"

src/Markdown/LinksChecker.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ private static function fetchLinkStatus(string $href): ?string
231231
]);
232232
try {
233233
$headers = @get_headers($href, false, $context);
234-
/** @phpstan-ignore function.alreadyNarrowedType */
235234
if (!\is_array($headers)) {
236235
continue;
237236
}

tests/Large/Markdown/LinksCheckerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ public function testItHandlesNonFileLinks(): void
6969
{
7070
try {
7171
$result = @\get_headers('https://httpstat.us/200');
72-
/** @phpstan-ignore identical.alwaysFalse */
7372
if (false === $result) {
7473
self::markTestSkipped('httpstat.us is not reachable (e.g. CI environment)');
7574
}

0 commit comments

Comments
 (0)