Skip to content

feat(php): Add PHP command filters - #1246

Closed
aaronflorey wants to merge 2 commits into
rtk-ai:masterfrom
aaronflorey:feat/php-command-filters-pr
Closed

aaronflorey wants to merge 2 commits into
rtk-ai:masterfrom
aaronflorey:feat/php-command-filters-pr

Conversation

@aaronflorey

Copy link
Copy Markdown
Contributor

Summary

  • add RTK support for php, php artisan, phpunit, phpstan, ecs, pest, and paratest
  • summarize syntax checks, test output, and PHPStan/ECS results with shared PHP helpers and docs
  • resolve Composer bin-dir overrides and Windows wrapper binaries during PHP tool detection and command rewriting

Verification

  • cargo fmt --all
  • cargo clippy --all-targets
  • cargo test --all

Add filtered support for php artisan, phpunit, phpstan, ecs, pest, and paratest so PHP projects get compact test and lint summaries like other ecosystems.

Resolve Composer bin-dir overrides and local Windows wrappers so project binaries are detected and rewritten correctly.
Use strip_prefix in the cat rewrite guard so the new PHP discovery path stays warning-free without changing behavior.
iliaal added a commit to iliaal/rtk that referenced this pull request Apr 30, 2026
…t, paratest, ecs, pint, artisan)

Consolidates three stalled upstream PRs plus a new .phpt filter and Pint
support into one coherent PHP ecosystem module:

- `rtk php` + `rtk artisan`: syntax check (-l) and Laravel artisan wrapper
- `rtk phpunit`: structured-state parser; aggregate counts + bounded failure list
  (sourced from rtk-ai#874, refactored to use runner::run_filtered and strip emoji)
- `rtk phpstan`: typed serde::Deserialize parser for --error-format=json;
  groups errors by file, sorts by count desc; handles utility commands
  (--version, list, clear-result-cache) as passthrough
  (sourced from rtk-ai#1110, strip emoji in success path)
- `rtk pest` + `rtk paratest`: shared test_output helper (from rtk-ai#1246)
- `rtk ecs` + `rtk pint`: code style fixers; pint uses --format=json for
  structured per-file rule counts
- `rtk phpt`: wraps `php run-tests.php` for php-src and PHP extensions;
  collapses per-test PASS chatter (99.5% byte reduction on a 5322-test run)

Composer custom-bin-dir detection: `composer_bin_dirs()` reads COMPOSER_BIN_DIR
and composer.json `config.bin-dir` so `tools/bin/phpunit` classifies identically
to `vendor/bin/phpunit`. registry.rs normalizes tool paths before matching
so one rule covers every Composer layout.

Sources:
- rtk-ai#1246 (aaronflorey): php, artisan, ecs, pest, paratest, test_output,
  utils, composer_bin_dirs + registry normalization. phpunit and phpstan stubs
  replaced with deeper implementations below.
- rtk-ai#874 (Beninho): phpunit state-machine parser (ported).
- rtk-ai#1110 (LucianoVandi): phpstan typed parser (emoji stripped).
- New: pint_cmd.rs, phpt_cmd.rs.

1744 tests pass (1683 baseline + 61 new).
iliaal added a commit to iliaal/rtk that referenced this pull request May 9, 2026
…t, paratest, ecs, pint, artisan)

Consolidates three stalled upstream PRs plus a new .phpt filter and Pint
support into one coherent PHP ecosystem module:

- `rtk php` + `rtk artisan`: syntax check (-l) and Laravel artisan wrapper
- `rtk phpunit`: structured-state parser; aggregate counts + bounded failure list
  (sourced from rtk-ai#874, refactored to use runner::run_filtered and strip emoji)
- `rtk phpstan`: typed serde::Deserialize parser for --error-format=json;
  groups errors by file, sorts by count desc; handles utility commands
  (--version, list, clear-result-cache) as passthrough
  (sourced from rtk-ai#1110, strip emoji in success path)
- `rtk pest` + `rtk paratest`: shared test_output helper (from rtk-ai#1246)
- `rtk ecs` + `rtk pint`: code style fixers; pint uses --format=json for
  structured per-file rule counts
- `rtk phpt`: wraps `php run-tests.php` for php-src and PHP extensions;
  collapses per-test PASS chatter (99.5% byte reduction on a 5322-test run)

Composer custom-bin-dir detection: `composer_bin_dirs()` reads COMPOSER_BIN_DIR
and composer.json `config.bin-dir` so `tools/bin/phpunit` classifies identically
to `vendor/bin/phpunit`. registry.rs normalizes tool paths before matching
so one rule covers every Composer layout.

Sources:
- rtk-ai#1246 (aaronflorey): php, artisan, ecs, pest, paratest, test_output,
  utils, composer_bin_dirs + registry normalization. phpunit and phpstan stubs
  replaced with deeper implementations below.
- rtk-ai#874 (Beninho): phpunit state-machine parser (ported).
- rtk-ai#1110 (LucianoVandi): phpstan typed parser (emoji stripped).
- New: pint_cmd.rs, phpt_cmd.rs.

1744 tests pass (1683 baseline + 61 new).
iliaal added a commit to iliaal/rtk that referenced this pull request May 17, 2026
…t, paratest, ecs, pint, artisan)

Consolidates three stalled upstream PRs plus a new .phpt filter and Pint
support into one coherent PHP ecosystem module:

- `rtk php` + `rtk artisan`: syntax check (-l) and Laravel artisan wrapper
- `rtk phpunit`: structured-state parser; aggregate counts + bounded failure list
  (sourced from rtk-ai#874, refactored to use runner::run_filtered and strip emoji)
- `rtk phpstan`: typed serde::Deserialize parser for --error-format=json;
  groups errors by file, sorts by count desc; handles utility commands
  (--version, list, clear-result-cache) as passthrough
  (sourced from rtk-ai#1110, strip emoji in success path)
- `rtk pest` + `rtk paratest`: shared test_output helper (from rtk-ai#1246)
- `rtk ecs` + `rtk pint`: code style fixers; pint uses --format=json for
  structured per-file rule counts
- `rtk phpt`: wraps `php run-tests.php` for php-src and PHP extensions;
  collapses per-test PASS chatter (99.5% byte reduction on a 5322-test run)

Composer custom-bin-dir detection: `composer_bin_dirs()` reads COMPOSER_BIN_DIR
and composer.json `config.bin-dir` so `tools/bin/phpunit` classifies identically
to `vendor/bin/phpunit`. registry.rs normalizes tool paths before matching
so one rule covers every Composer layout.

Sources:
- rtk-ai#1246 (aaronflorey): php, artisan, ecs, pest, paratest, test_output,
  utils, composer_bin_dirs + registry normalization. phpunit and phpstan stubs
  replaced with deeper implementations below.
- rtk-ai#874 (Beninho): phpunit state-machine parser (ported).
- rtk-ai#1110 (LucianoVandi): phpstan typed parser (emoji stripped).
- New: pint_cmd.rs, phpt_cmd.rs.

1744 tests pass (1683 baseline + 61 new).
iliaal added a commit to iliaal/rtk that referenced this pull request May 17, 2026
…pest, paratest, ecs, pint)

Consolidates the PHP-tooling work from three upstream PRs plus a new
Pint module, leaving phpt to its own PR (rtk-ai#1503).

- rtk php / rtk artisan: syntax check (-l) and Laravel artisan wrapper.
- rtk phpunit: structured-state parser, aggregate counts, bounded
  failure list. Uses runner::run_filtered.
- rtk phpstan: typed serde::Deserialize parser for --error-format=json,
  groups errors by file, sorts by count desc. Utility commands
  (--version, list, clear-result-cache) pass through unchanged.
- rtk pest / rtk paratest: shared test_output helper.
- rtk ecs / rtk pint: code-style fixers; pint uses --format=json for
  structured per-file rule counts.

Composer custom-bin-dir detection: composer_bin_dirs() reads
COMPOSER_BIN_DIR and composer.json config.bin-dir, so tools/bin/phpunit
classifies identically to vendor/bin/phpunit. registry.rs normalizes
tool paths before matching.

Sources:
- rtk-ai#1246 (aaronflorey, self-closed): php, artisan, ecs, pest,
  paratest, test_output, utils, composer_bin_dirs, registry normalization.
- rtk-ai#874 (Beninho, open): phpunit state-machine parser.
- rtk-ai#1110 (LucianoVandi, open): phpstan typed parser.
- New: pint_cmd.rs.

Tests: discover::registry 253 pass; cmds::php 36 pass; cargo build
--release 0 errors; cargo fmt --check clean.
iliaal added a commit to iliaal/rtk that referenced this pull request May 30, 2026
…t, paratest, ecs, pint, artisan)

Consolidates three stalled upstream PRs plus a new .phpt filter and Pint
support into one coherent PHP ecosystem module:

- `rtk php` + `rtk artisan`: syntax check (-l) and Laravel artisan wrapper
- `rtk phpunit`: structured-state parser; aggregate counts + bounded failure list
  (sourced from rtk-ai#874, refactored to use runner::run_filtered and strip emoji)
- `rtk phpstan`: typed serde::Deserialize parser for --error-format=json;
  groups errors by file, sorts by count desc; handles utility commands
  (--version, list, clear-result-cache) as passthrough
  (sourced from rtk-ai#1110, strip emoji in success path)
- `rtk pest` + `rtk paratest`: shared test_output helper (from rtk-ai#1246)
- `rtk ecs` + `rtk pint`: code style fixers; pint uses --format=json for
  structured per-file rule counts
- `rtk phpt`: wraps `php run-tests.php` for php-src and PHP extensions;
  collapses per-test PASS chatter (99.5% byte reduction on a 5322-test run)

Composer custom-bin-dir detection: `composer_bin_dirs()` reads COMPOSER_BIN_DIR
and composer.json `config.bin-dir` so `tools/bin/phpunit` classifies identically
to `vendor/bin/phpunit`. registry.rs normalizes tool paths before matching
so one rule covers every Composer layout.

Sources:
- rtk-ai#1246 (aaronflorey): php, artisan, ecs, pest, paratest, test_output,
  utils, composer_bin_dirs + registry normalization. phpunit and phpstan stubs
  replaced with deeper implementations below.
- rtk-ai#874 (Beninho): phpunit state-machine parser (ported).
- rtk-ai#1110 (LucianoVandi): phpstan typed parser (emoji stripped).
- New: pint_cmd.rs, phpt_cmd.rs.

1744 tests pass (1683 baseline + 61 new).
iliaal added a commit to iliaal/rtk that referenced this pull request May 30, 2026
…pest, paratest, ecs, pint)

Consolidates the PHP-tooling work from three upstream PRs plus a new
Pint module, leaving phpt to its own PR (rtk-ai#1503).

- rtk php / rtk artisan: syntax check (-l) and Laravel artisan wrapper.
- rtk phpunit: structured-state parser, aggregate counts, bounded
  failure list. Uses runner::run_filtered.
- rtk phpstan: typed serde::Deserialize parser for --error-format=json,
  groups errors by file, sorts by count desc. Utility commands
  (--version, list, clear-result-cache) pass through unchanged.
- rtk pest / rtk paratest: shared test_output helper.
- rtk ecs / rtk pint: code-style fixers; pint uses --format=json for
  structured per-file rule counts.

Composer custom-bin-dir detection: composer_bin_dirs() reads
COMPOSER_BIN_DIR and composer.json config.bin-dir, so tools/bin/phpunit
classifies identically to vendor/bin/phpunit. registry.rs normalizes
tool paths before matching.

Sources:
- rtk-ai#1246 (aaronflorey, self-closed): php, artisan, ecs, pest,
  paratest, test_output, utils, composer_bin_dirs, registry normalization.
- rtk-ai#874 (Beninho, open): phpunit state-machine parser.
- rtk-ai#1110 (LucianoVandi, open): phpstan typed parser.
- New: pint_cmd.rs.

Tests: discover::registry 253 pass; cmds::php 36 pass; cargo build
--release 0 errors; cargo fmt --check clean.
iliaal added a commit to iliaal/rtk that referenced this pull request Jun 9, 2026
…pest, paratest, ecs, pint)

Consolidates the PHP-tooling work from three upstream PRs plus a new
Pint module, leaving phpt to its own PR (rtk-ai#1503).

- rtk php / rtk artisan: syntax check (-l) and Laravel artisan wrapper.
- rtk phpunit: structured-state parser, aggregate counts, bounded
  failure list. Uses runner::run_filtered.
- rtk phpstan: typed serde::Deserialize parser for --error-format=json,
  groups errors by file, sorts by count desc. Utility commands
  (--version, list, clear-result-cache) pass through unchanged.
- rtk pest / rtk paratest: shared test_output helper.
- rtk ecs / rtk pint: code-style fixers; pint uses --format=json for
  structured per-file rule counts.

Composer custom-bin-dir detection: composer_bin_dirs() reads
COMPOSER_BIN_DIR and composer.json config.bin-dir, so tools/bin/phpunit
classifies identically to vendor/bin/phpunit. registry.rs normalizes
tool paths before matching.

Sources:
- rtk-ai#1246 (aaronflorey, self-closed): php, artisan, ecs, pest,
  paratest, test_output, utils, composer_bin_dirs, registry normalization.
- rtk-ai#874 (Beninho, open): phpunit state-machine parser.
- rtk-ai#1110 (LucianoVandi, open): phpstan typed parser.
- New: pint_cmd.rs.

Tests: discover::registry 253 pass; cmds::php 36 pass; cargo build
--release 0 errors; cargo fmt --check clean.
iliaal added a commit to iliaal/rtk that referenced this pull request Jun 9, 2026
…t, paratest, ecs, pint, artisan)

Consolidates three stalled upstream PRs plus a new .phpt filter and Pint
support into one coherent PHP ecosystem module:

- `rtk php` + `rtk artisan`: syntax check (-l) and Laravel artisan wrapper
- `rtk phpunit`: structured-state parser; aggregate counts + bounded failure list
  (sourced from rtk-ai#874, refactored to use runner::run_filtered and strip emoji)
- `rtk phpstan`: typed serde::Deserialize parser for --error-format=json;
  groups errors by file, sorts by count desc; handles utility commands
  (--version, list, clear-result-cache) as passthrough
  (sourced from rtk-ai#1110, strip emoji in success path)
- `rtk pest` + `rtk paratest`: shared test_output helper (from rtk-ai#1246)
- `rtk ecs` + `rtk pint`: code style fixers; pint uses --format=json for
  structured per-file rule counts
- `rtk phpt`: wraps `php run-tests.php` for php-src and PHP extensions;
  collapses per-test PASS chatter (99.5% byte reduction on a 5322-test run)

Composer custom-bin-dir detection: `composer_bin_dirs()` reads COMPOSER_BIN_DIR
and composer.json `config.bin-dir` so `tools/bin/phpunit` classifies identically
to `vendor/bin/phpunit`. registry.rs normalizes tool paths before matching
so one rule covers every Composer layout.

Sources:
- rtk-ai#1246 (aaronflorey): php, artisan, ecs, pest, paratest, test_output,
  utils, composer_bin_dirs + registry normalization. phpunit and phpstan stubs
  replaced with deeper implementations below.
- rtk-ai#874 (Beninho): phpunit state-machine parser (ported).
- rtk-ai#1110 (LucianoVandi): phpstan typed parser (emoji stripped).
- New: pint_cmd.rs, phpt_cmd.rs.

1744 tests pass (1683 baseline + 61 new).
iliaal added a commit to iliaal/rtk that referenced this pull request Jun 18, 2026
…t, paratest, ecs, pint, artisan)

Consolidates three stalled upstream PRs plus a new .phpt filter and Pint
support into one coherent PHP ecosystem module:

- `rtk php` + `rtk artisan`: syntax check (-l) and Laravel artisan wrapper
- `rtk phpunit`: structured-state parser; aggregate counts + bounded failure list
  (sourced from rtk-ai#874, refactored to use runner::run_filtered and strip emoji)
- `rtk phpstan`: typed serde::Deserialize parser for --error-format=json;
  groups errors by file, sorts by count desc; handles utility commands
  (--version, list, clear-result-cache) as passthrough
  (sourced from rtk-ai#1110, strip emoji in success path)
- `rtk pest` + `rtk paratest`: shared test_output helper (from rtk-ai#1246)
- `rtk ecs` + `rtk pint`: code style fixers; pint uses --format=json for
  structured per-file rule counts
- `rtk phpt`: wraps `php run-tests.php` for php-src and PHP extensions;
  collapses per-test PASS chatter (99.5% byte reduction on a 5322-test run)

Composer custom-bin-dir detection: `composer_bin_dirs()` reads COMPOSER_BIN_DIR
and composer.json `config.bin-dir` so `tools/bin/phpunit` classifies identically
to `vendor/bin/phpunit`. registry.rs normalizes tool paths before matching
so one rule covers every Composer layout.

Sources:
- rtk-ai#1246 (aaronflorey): php, artisan, ecs, pest, paratest, test_output,
  utils, composer_bin_dirs + registry normalization. phpunit and phpstan stubs
  replaced with deeper implementations below.
- rtk-ai#874 (Beninho): phpunit state-machine parser (ported).
- rtk-ai#1110 (LucianoVandi): phpstan typed parser (emoji stripped).
- New: pint_cmd.rs, phpt_cmd.rs.

1744 tests pass (1683 baseline + 61 new).
iliaal added a commit to iliaal/rtk that referenced this pull request Jun 26, 2026
…pest, paratest, ecs, pint)

Consolidates the PHP-tooling work from three upstream PRs plus a new
Pint module, leaving phpt to its own PR (rtk-ai#1503).

- rtk php / rtk artisan: syntax check (-l) and Laravel artisan wrapper.
- rtk phpunit: structured-state parser, aggregate counts, bounded
  failure list. Uses runner::run_filtered.
- rtk phpstan: typed serde::Deserialize parser for --error-format=json,
  groups errors by file, sorts by count desc. Utility commands
  (--version, list, clear-result-cache) pass through unchanged.
- rtk pest / rtk paratest: shared test_output helper.
- rtk ecs / rtk pint: code-style fixers; pint uses --format=json for
  structured per-file rule counts.

Composer custom-bin-dir detection: composer_bin_dirs() reads
COMPOSER_BIN_DIR and composer.json config.bin-dir, so tools/bin/phpunit
classifies identically to vendor/bin/phpunit. registry.rs normalizes
tool paths before matching.

Sources:
- rtk-ai#1246 (aaronflorey, self-closed): php, artisan, ecs, pest,
  paratest, test_output, utils, composer_bin_dirs, registry normalization.
- rtk-ai#874 (Beninho, open): phpunit state-machine parser.
- rtk-ai#1110 (LucianoVandi, open): phpstan typed parser.
- New: pint_cmd.rs.

Tests: discover::registry 253 pass; cmds::php 36 pass; cargo build
--release 0 errors; cargo fmt --check clean.
iliaal added a commit to iliaal/rtk that referenced this pull request Jul 20, 2026
…pest, paratest, ecs, pint)

Consolidates the PHP-tooling work from three upstream PRs plus a new
Pint module, leaving phpt to its own PR (rtk-ai#1503).

- rtk php / rtk artisan: syntax check (-l) and Laravel artisan wrapper.
- rtk phpunit: structured-state parser, aggregate counts, bounded
  failure list. Uses runner::run_filtered.
- rtk phpstan: typed serde::Deserialize parser for --error-format=json,
  groups errors by file, sorts by count desc. Utility commands
  (--version, list, clear-result-cache) pass through unchanged.
- rtk pest / rtk paratest: shared test_output helper.
- rtk ecs / rtk pint: code-style fixers; pint uses --format=json for
  structured per-file rule counts.

Composer custom-bin-dir detection: composer_bin_dirs() reads
COMPOSER_BIN_DIR and composer.json config.bin-dir, so tools/bin/phpunit
classifies identically to vendor/bin/phpunit. registry.rs normalizes
tool paths before matching.

Sources:
- rtk-ai#1246 (aaronflorey, self-closed): php, artisan, ecs, pest,
  paratest, test_output, utils, composer_bin_dirs, registry normalization.
- rtk-ai#874 (Beninho, open): phpunit state-machine parser.
- rtk-ai#1110 (LucianoVandi, open): phpstan typed parser.
- New: pint_cmd.rs.

Tests: discover::registry 253 pass; cmds::php 36 pass; cargo build
--release 0 errors; cargo fmt --check clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant