diff --git a/.github/workflows/cs-fix.yml b/.github/workflows/cs-fix.yml index 5122bcd5..e3e98c32 100644 --- a/.github/workflows/cs-fix.yml +++ b/.github/workflows/cs-fix.yml @@ -8,8 +8,8 @@ on: - 'bridge/**' - 'tests/**' - 'testo.php' - - 'tools/code-style/.php-cs-fixer.dist.php' - - 'tools/code-style/composer.json' + - 'vendor-bin/code-style/.php-cs-fixer.dist.php' + - 'vendor-bin/code-style/composer.json' - 'composer.json' - 'composer.lock' - '.github/workflows/cs-fix.yml' diff --git a/.github/workflows/infection.yml b/.github/workflows/infection.yml index 0f82cc1d..0e62e77f 100644 --- a/.github/workflows/infection.yml +++ b/.github/workflows/infection.yml @@ -8,10 +8,10 @@ on: - 'bridge/**' - 'tests/**' - 'bin/**' - - 'tools/phpunit/composer.json' + - 'vendor-bin/phpunit/composer.json' - 'infection.json' - - 'tools/phpunit/infection.phpunit.json' - - 'tools/phpunit/phpunit.xml' + - 'vendor-bin/phpunit/infection.phpunit.json' + - 'vendor-bin/phpunit/phpunit.xml' - 'testo.php' - 'composer.json' - 'composer.lock' @@ -23,10 +23,10 @@ on: - 'bridge/**' - 'tests/**' - 'bin/**' - - 'tools/phpunit/composer.json' + - 'vendor-bin/phpunit/composer.json' - 'infection.json' - - 'tools/phpunit/infection.phpunit.json' - - 'tools/phpunit/phpunit.xml' + - 'vendor-bin/phpunit/infection.phpunit.json' + - 'vendor-bin/phpunit/phpunit.xml' - 'testo.php' - 'composer.json' - 'composer.lock' diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index adec1290..7a5a844e 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -4,16 +4,16 @@ on: push: paths: - 'core/**' - - 'tools/psalm/psalm.xml' - - 'tools/psalm/composer.json' + - 'vendor-bin/psalm/psalm.xml' + - 'vendor-bin/psalm/composer.json' - 'composer.json' - 'composer.lock' - '.github/workflows/psalm.yml' pull_request: paths: - 'core/**' - - 'tools/psalm/psalm.xml' - - 'tools/psalm/composer.json' + - 'vendor-bin/psalm/psalm.xml' + - 'vendor-bin/psalm/composer.json' - 'composer.json' - 'composer.lock' - '.github/workflows/psalm.yml' diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml index 83b787ec..3bb8e485 100644 --- a/.github/workflows/rector.yml +++ b/.github/workflows/rector.yml @@ -6,7 +6,7 @@ on: - 'core/**' - 'plugin/**' - 'bridge/**' - - 'tools/rector/rector.php' + - 'vendor-bin/rector/rector.php' - 'composer.json' - 'composer.lock' - '.github/workflows/rector.yml' @@ -15,7 +15,7 @@ on: - 'core/**' - 'plugin/**' - 'bridge/**' - - 'tools/rector/rector.php' + - 'vendor-bin/rector/rector.php' - 'composer.json' - 'composer.lock' - '.github/workflows/rector.yml' @@ -46,7 +46,7 @@ jobs: with: dependency-versions: highest - # rector is isolated in tools/rector; bin-links put its binary on vendor/bin. + # rector is isolated in vendor-bin/rector; bin-links put its binary on vendor/bin. - name: Install bin tools run: composer bin all install --ignore-platform-req=php diff --git a/.github/workflows/structarmed.yml b/.github/workflows/structarmed.yml index 0eb9f725..bfbec7bb 100644 --- a/.github/workflows/structarmed.yml +++ b/.github/workflows/structarmed.yml @@ -6,7 +6,7 @@ on: - 'core/**' - 'plugin/**' - 'bridge/**' - - 'tools/structarmed/**' + - 'vendor-bin/structarmed/**' - 'composer.json' - 'composer.lock' - '.github/workflows/structarmed.yml' @@ -15,7 +15,7 @@ on: - 'core/**' - 'plugin/**' - 'bridge/**' - - 'tools/structarmed/**' + - 'vendor-bin/structarmed/**' - 'composer.json' - 'composer.lock' - '.github/workflows/structarmed.yml' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4913040a..d11d4f28 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -68,7 +68,7 @@ jobs: dependency-versions: ${{ matrix.dependencies }} paths: core plugin bridge tests testo.php - # Bin tools carry deps with a higher PHP floor than the matrix (e.g. tools/double). + # Bin tools carry deps with a higher PHP floor than the matrix (e.g. vendor-bin/double). # They install everywhere but only load where the platform allows, so ignore the check. - name: Install bin tools run: composer bin all install --ignore-platform-req=php diff --git a/.gitignore b/.gitignore index 63206494..d3443ce5 100644 --- a/.gitignore +++ b/.gitignore @@ -5,9 +5,6 @@ /runtime/ /vendor/ /tests/PhpUnit/ -/tools/*/vendor/ -/tools/*/.agents/ -/tools/*/.claude/ /.env *.log *.exe diff --git a/bin/Rector/RenameFinalMethodCollisionRector.php b/bin/Rector/RenameFinalMethodCollisionRector.php index 6dc72aa3..5b022429 100644 --- a/bin/Rector/RenameFinalMethodCollisionRector.php +++ b/bin/Rector/RenameFinalMethodCollisionRector.php @@ -26,7 +26,7 @@ * which TestCase/Assert declare `final`. The method (and every `$this->`/`self::`/`static::` call to * it within the same class) is renamed by appending `_` until the name no longer collides and is * free in the class. The final method names are injected via configuration (the rector config reads - * them by reflection from the isolated tools/phpunit install at boot — native reflection inside a + * them by reflection from the isolated vendor-bin/phpunit install at boot — native reflection inside a * running rule is unreliable, returning an empty set). * * Only classes that already extend `\PHPUnit\Framework\TestCase` are touched (run after diff --git a/bin/phpunit-coverage.php b/bin/phpunit-coverage.php index b11c8919..8520bcd2 100644 --- a/bin/phpunit-coverage.php +++ b/bin/phpunit-coverage.php @@ -25,13 +25,13 @@ $covDir = $argv[1] ?? 'runtime/phpunit-cov'; $covDir = \rtrim(\str_replace('\\', '/', $covDir), '/'); -$phpunit = $root . '/tools/phpunit/vendor/phpunit/phpunit/phpunit'; +$phpunit = $root . '/vendor-bin/phpunit/vendor/phpunit/phpunit/phpunit'; $command = \array_map('escapeshellarg', [ \PHP_BINARY, $phpunit, '--configuration', - $root . '/tools/phpunit/phpunit.xml', + $root . '/vendor-bin/phpunit/phpunit.xml', // Keep the report lean and reproducible: drop the per-file source token dump, and never let a // stale test-result cache reorder or skip cases (matches how Infection drives PHPUnit). '--exclude-source-from-xml-coverage', diff --git a/bin/rector-phpunit-build.php b/bin/rector-phpunit-build.php index 79a803cd..cce04175 100644 --- a/bin/rector-phpunit-build.php +++ b/bin/rector-phpunit-build.php @@ -37,14 +37,14 @@ /** * Every `final` method PHPUnit's TestCase inherits, read by reflection from the isolated - * tools/phpunit install. Done here at config-boot (plain PHP) rather than inside the rule, where + * vendor-bin/phpunit install. Done here at config-boot (plain PHP) rather than inside the rule, where * native reflection of TestCase is unreliable. * * @return list */ function finalTestCaseMethods(): array { - require_once __DIR__ . '/../tools/phpunit/vendor/autoload.php'; + require_once __DIR__ . '/../vendor-bin/phpunit/vendor/autoload.php'; $names = []; foreach ((new \ReflectionClass(\PHPUnit\Framework\TestCase::class))->getMethods() as $method) { diff --git a/composer.json b/composer.json index c8ed6fa6..f61c19e5 100644 --- a/composer.json +++ b/composer.json @@ -177,14 +177,14 @@ "bamarni-bin": { "bin-links": true, "forward-command": false, - "target-directory": "tools" + "target-directory": "vendor-bin" } }, "scripts": { - "cs:diff": "php-cs-fixer fix --dry-run -v --diff --config=tools/code-style/.php-cs-fixer.dist.php", - "cs:fix": "php-cs-fixer fix -v --config=tools/code-style/.php-cs-fixer.dist.php", - "rector": "rector --config=tools/rector/rector.php", - "rector:ci": "rector --config=tools/rector/rector.php --dry-run --clear-cache --no-progress-bar", + "cs:diff": "php-cs-fixer fix --dry-run -v --diff --config=vendor-bin/code-style/.php-cs-fixer.dist.php", + "cs:fix": "php-cs-fixer fix -v --config=vendor-bin/code-style/.php-cs-fixer.dist.php", + "rector": "rector --config=vendor-bin/rector/rector.php", + "rector:ci": "rector --config=vendor-bin/rector/rector.php --dry-run --clear-cache --no-progress-bar", "infect": [ "@putenv TESTO_CI=1", "@putenv XDEBUG_MODE=coverage", @@ -201,21 +201,21 @@ "@composer dump-autoload --quiet", "rector process --config=bin/rector-phpunit-build.php --no-diffs --no-progress-bar" ], - "phpunit": "phpunit --configuration tools/phpunit/phpunit.xml", + "phpunit": "phpunit --configuration vendor-bin/phpunit/phpunit.xml", "infect:phpunit": [ "@putenv XDEBUG_MODE=coverage", "@php bin/phpunit-coverage.php runtime/phpunit-cov", - "infection --configuration=tools/phpunit/infection.phpunit.json --coverage=../../runtime/phpunit-cov --skip-initial-tests --threads=max --min-msi=0" + "infection --configuration=vendor-bin/phpunit/infection.phpunit.json --coverage=../../runtime/phpunit-cov --skip-initial-tests --threads=max --min-msi=0" ], "infect:phpunit:ci": [ "@putenv XDEBUG_MODE=coverage", "@php bin/phpunit-coverage.php runtime/phpunit-cov", - "infection --ansi --configuration=tools/phpunit/infection.phpunit.json --coverage=../../runtime/phpunit-cov --skip-initial-tests --logger-github --threads=max --show-mutations=0 --min-msi=0" + "infection --ansi --configuration=vendor-bin/phpunit/infection.phpunit.json --coverage=../../runtime/phpunit-cov --skip-initial-tests --logger-github --threads=max --show-mutations=0 --min-msi=0" ], - "psalm": "psalm -c tools/psalm/psalm.xml", - "psalm:baseline": "psalm -c tools/psalm/psalm.xml --set-baseline=tools/psalm/psalm-baseline.xml", - "psalm:ci": "psalm -c tools/psalm/psalm.xml --output-format=github --shepherd --show-info=false --stats --threads=4", - "structarmed": "structarmed analyse --config=tools/structarmed/structarmed.php --clear-cache", + "psalm": "psalm -c vendor-bin/psalm/psalm.xml", + "psalm:baseline": "psalm -c vendor-bin/psalm/psalm.xml --set-baseline=vendor-bin/psalm/psalm-baseline.xml", + "psalm:ci": "psalm -c vendor-bin/psalm/psalm.xml --output-format=github --shepherd --show-info=false --stats --threads=4", + "structarmed": "structarmed analyse --config=vendor-bin/structarmed/structarmed.php --clear-cache", "test": "testo", "test:ci": [ "@putenv TESTO_CI=1", diff --git a/infection.json b/infection.json index 165c7fd6..be38abbb 100644 --- a/infection.json +++ b/infection.json @@ -1,5 +1,5 @@ { - "$schema": "tools/infection/vendor/infection/infection/resources/schema.json", + "$schema": "vendor-bin/infection/vendor/infection/infection/resources/schema.json", "source": { "directories": [ "core", diff --git a/tests/bootstrap.php b/tests/bootstrap.php index f2087edc..3d309f4c 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -6,20 +6,20 @@ * Shared autoload bootstrap for every runner over Testo's own suite: the Testo CLI (testo.php), * the generated PHPUnit mirror (phpunit.xml) and mutation testing on top of either. * - * It loads the root autoloader, then the isolated bamarni-bin vendors under tools/ that hold the + * It loads the root autoloader, then the isolated bamarni-bin vendors under vendor-bin/ that hold the * bridge runtime deps kept out of the root install — a higher PHP floor (double) or heavy/foreign * transitive deps (vcr, mockery, revolt, rector). The is_file() guard keeps a run working when a * bin namespace was not installed (double on PHP 8.2, a job that skipped it); the bridge's own * suites.php still gates itself on the platform it needs. * * Only bridge vendors are listed. The standalone dev tools (psalm, phpunit, infection, code-style) - * also live under tools/, but their nikic/symfony deps differ by version and would clash if loaded + * also live under vendor-bin/, but their nikic/symfony deps differ by version and would clash if loaded * into the same process as the tests. */ require_once __DIR__ . '/../vendor/autoload.php'; foreach (['double', 'vcr', 'mockery', 'revolt', 'rector'] as $binNamespace) { - $autoload = __DIR__ . "/../tools/{$binNamespace}/vendor/autoload.php"; + $autoload = __DIR__ . "/../vendor-bin/{$binNamespace}/vendor/autoload.php"; \is_file($autoload) and require_once $autoload; } diff --git a/tools/psalm/composer.json b/tools/psalm/composer.json deleted file mode 100644 index 0460ad88..00000000 --- a/tools/psalm/composer.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "require": { - "roxblnfk/unpoly": "^1.8.2", - "vimeo/psalm": "^7" - }, - "minimum-stability": "dev", - "prefer-stable": true -} diff --git a/vendor-bin/code-style/.gitignore b/vendor-bin/code-style/.gitignore new file mode 100644 index 00000000..d4da745a --- /dev/null +++ b/vendor-bin/code-style/.gitignore @@ -0,0 +1,4 @@ +/vendor/ +/composer.lock +/.*/ +/skills.json diff --git a/tools/code-style/.php-cs-fixer.dist.php b/vendor-bin/code-style/.php-cs-fixer.dist.php similarity index 85% rename from tools/code-style/.php-cs-fixer.dist.php rename to vendor-bin/code-style/.php-cs-fixer.dist.php index 0267ee95..b484539e 100644 --- a/tools/code-style/.php-cs-fixer.dist.php +++ b/vendor-bin/code-style/.php-cs-fixer.dist.php @@ -2,7 +2,7 @@ declare(strict_types=1); -// This config lives under tools/code-style/, next to its isolated php-cs-fixer install: the +// This config lives under vendor-bin/code-style/, next to its isolated php-cs-fixer install: the // autoloader sits alongside it, and the __DIR__-based source paths reach the project root with ../../. require_once __DIR__ . '/vendor/autoload.php'; @@ -41,6 +41,6 @@ function expandWildcardDirs(string ...$patterns): array return $builder // Keep the cache in the root runtime/ (git-ignored); the default is relative to this config's - // own directory, which would otherwise litter tools/code-style/ with an untracked cache file. + // own directory, which would otherwise litter vendor-bin/code-style/ with an untracked cache file. ->cache(__DIR__ . '/../../runtime/php-cs-fixer.cache') ->build(); diff --git a/tools/code-style/composer.json b/vendor-bin/code-style/composer.json similarity index 100% rename from tools/code-style/composer.json rename to vendor-bin/code-style/composer.json diff --git a/vendor-bin/double/.gitignore b/vendor-bin/double/.gitignore new file mode 100644 index 00000000..d4da745a --- /dev/null +++ b/vendor-bin/double/.gitignore @@ -0,0 +1,4 @@ +/vendor/ +/composer.lock +/.*/ +/skills.json diff --git a/tools/double/composer.json b/vendor-bin/double/composer.json similarity index 100% rename from tools/double/composer.json rename to vendor-bin/double/composer.json diff --git a/vendor-bin/infection/.gitignore b/vendor-bin/infection/.gitignore new file mode 100644 index 00000000..d4da745a --- /dev/null +++ b/vendor-bin/infection/.gitignore @@ -0,0 +1,4 @@ +/vendor/ +/composer.lock +/.*/ +/skills.json diff --git a/tools/infection/composer.json b/vendor-bin/infection/composer.json similarity index 100% rename from tools/infection/composer.json rename to vendor-bin/infection/composer.json diff --git a/vendor-bin/mockery/.gitignore b/vendor-bin/mockery/.gitignore new file mode 100644 index 00000000..d4da745a --- /dev/null +++ b/vendor-bin/mockery/.gitignore @@ -0,0 +1,4 @@ +/vendor/ +/composer.lock +/.*/ +/skills.json diff --git a/tools/mockery/composer.json b/vendor-bin/mockery/composer.json similarity index 100% rename from tools/mockery/composer.json rename to vendor-bin/mockery/composer.json diff --git a/vendor-bin/phpunit/.gitignore b/vendor-bin/phpunit/.gitignore new file mode 100644 index 00000000..d4da745a --- /dev/null +++ b/vendor-bin/phpunit/.gitignore @@ -0,0 +1,4 @@ +/vendor/ +/composer.lock +/.*/ +/skills.json diff --git a/tools/phpunit/composer.json b/vendor-bin/phpunit/composer.json similarity index 100% rename from tools/phpunit/composer.json rename to vendor-bin/phpunit/composer.json diff --git a/tools/phpunit/infection-bootstrap.php b/vendor-bin/phpunit/infection-bootstrap.php similarity index 85% rename from tools/phpunit/infection-bootstrap.php rename to vendor-bin/phpunit/infection-bootstrap.php index 300d5327..37750af8 100644 --- a/tools/phpunit/infection-bootstrap.php +++ b/vendor-bin/phpunit/infection-bootstrap.php @@ -6,7 +6,7 @@ * Included into Infection's own process (the `bootstrap` option of infection.phpunit.json). * * Infection loads every covered source class to generate its mutants. The Rector bridge rules extend - * Rector's classes, which live in the isolated tools/rector vendor rather than the root install, so + * Rector's classes, which live in the isolated vendor-bin/rector vendor rather than the root install, so * without this the first covered rule stops the whole run. Rector ships its dependencies scoped, * and nikic/php-parser keeps resolving from Infection's vendor. The other bridge vendors carry * unscoped symfony/nikic deps that would clash with Infection's, so only Rector is loaded. diff --git a/tools/phpunit/infection.phpunit.json b/vendor-bin/phpunit/infection.phpunit.json similarity index 95% rename from tools/phpunit/infection.phpunit.json rename to vendor-bin/phpunit/infection.phpunit.json index f60d94c3..5b1b88da 100644 --- a/tools/phpunit/infection.phpunit.json +++ b/vendor-bin/phpunit/infection.phpunit.json @@ -25,7 +25,7 @@ "../../bridge/vcr/src" ] }, - "bootstrap": "tools/phpunit/infection-bootstrap.php", + "bootstrap": "vendor-bin/phpunit/infection-bootstrap.php", "timeout": 10, "testFramework": "phpunit", "phpUnit": { diff --git a/tools/phpunit/phpunit.xml b/vendor-bin/phpunit/phpunit.xml similarity index 97% rename from tools/phpunit/phpunit.xml rename to vendor-bin/phpunit/phpunit.xml index 251bf4dd..b6c6dc03 100644 --- a/tools/phpunit/phpunit.xml +++ b/vendor-bin/phpunit/phpunit.xml @@ -6,7 +6,7 @@ bridge/rector/README.md "Why Testo -> PHPUnit"). Not the primary test runner — `composer test` (Testo) is. - This config lives under tools/phpunit/, next to its isolated PHPUnit install; its paths are + This config lives under vendor-bin/phpunit/, next to its isolated PHPUnit install; its paths are therefore relative to this directory. PHPUnit resolves them against the config's own location, and Infection rewrites them against `phpUnit.configDir` from infection.phpunit.json. diff --git a/vendor-bin/psalm/.gitignore b/vendor-bin/psalm/.gitignore new file mode 100644 index 00000000..942aad27 --- /dev/null +++ b/vendor-bin/psalm/.gitignore @@ -0,0 +1,3 @@ +/vendor/ +/composer.lock +/.*/ diff --git a/vendor-bin/psalm/composer.json b/vendor-bin/psalm/composer.json new file mode 100644 index 00000000..aa307a8f --- /dev/null +++ b/vendor-bin/psalm/composer.json @@ -0,0 +1,14 @@ +{ + "require": { + "llm/skills": "^1.22", + "roxblnfk/unpoly": "^1.8.2", + "vimeo/psalm": "^7" + }, + "minimum-stability": "dev", + "prefer-stable": true, + "config": { + "allow-plugins": { + "llm/skills": true + } + } +} diff --git a/tools/psalm/psalm-baseline.xml b/vendor-bin/psalm/psalm-baseline.xml similarity index 100% rename from tools/psalm/psalm-baseline.xml rename to vendor-bin/psalm/psalm-baseline.xml diff --git a/tools/psalm/psalm.xml b/vendor-bin/psalm/psalm.xml similarity index 91% rename from tools/psalm/psalm.xml rename to vendor-bin/psalm/psalm.xml index 77d1e63d..584265fb 100644 --- a/tools/psalm/psalm.xml +++ b/vendor-bin/psalm/psalm.xml @@ -1,6 +1,6 @@