Skip to content

Run rector-src tests and PHPStan with this phpdoc-parser - #332

Merged
ondrejmirtes merged 3 commits into
2.3.xfrom
test-rector-src
Oct 26, 2026
Merged

ondrejmirtes merged 3 commits into
2.3.xfrom
test-rector-src

Conversation

@ondrejmirtes

@ondrejmirtes ondrejmirtes commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Adds a workflow that runs Rector against this repository's phpdoc-parser:

  1. Checks out phpstan/phpstan-src 2.3.x, replaces vendor/phpstan/phpdoc-parser/src with this repository's src/, and compiles phpstan.phar the same way phpstan-src's PHAR workflow does (compiler/bin/prepare, composer dump, box compile).
  2. Checks out rectorphp/rector-src main, replaces both vendor/phpstan/phpdoc-parser/src and vendor/phpstan/phpstan/phpstan.phar. Rector's bootstrap does not load PHPStan\PhpDocParser\ classes from the PHAR, so both copies have to be replaced.
  3. Runs Rector's tests (vendor/bin/fastunit tests rules-tests utils/phpstan/tests, PHP 8.4 and 8.5) and vendor/bin/phpstan analyse (PHP 8.4, the same version Rector's own CI uses; on PHP 8.5 PHPStan reports errors in Rector's code about null array keys and $argv, which Rector does not fix yet).

Ran the same steps locally on PHP 8.4: the compiled PHAR contains this repository's phpdoc-parser, Rector's tests passed, and PHPStan reported no errors.

Amp thread: https://ampcode.com/threads/T-01a179a5-580c-7253-9c42-00ace3f03617

Comment on lines +36 to +37
- name: "Checkout"
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Comment on lines +39 to +44
- name: "Checkout rector-src"
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: rectorphp/rector-src
path: rector-src
ref: main
Comment thread .github/workflows/test-rector-src.yml Fixed
Comment on lines +36 to +41
- name: "Checkout phpstan-src"
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: phpstan/phpstan-src
path: phpstan-src
ref: 2.3.x
ref: main

- name: "Install PHP"
uses: "shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962" # v2
with:
repository: phpstan/phpstan-src
path: phpstan-src
ref: 2.3.x
@ondrejmirtes
ondrejmirtes merged commit f2d34d5 into 2.3.x Oct 26, 2026
65 of 66 checks passed
@ondrejmirtes
ondrejmirtes deleted the test-rector-src branch October 26, 2026 21:02
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.

2 participants