Skip to content

Bump to PHPStan ^2.1.35 - #7847

Closed
samsonasik wants to merge 1 commit into
mainfrom
bump-phpstan-2135
Closed

Bump to PHPStan ^2.1.35#7847
samsonasik wants to merge 1 commit into
mainfrom
bump-phpstan-2135

Conversation

@samsonasik

@samsonasiksamsonasik commented Jan 21, 2026

Copy link
Copy Markdown
Member

@calebdw@TomasVotruba this PR bump to PHPStan 2.1.35.

It seems scope process node is changed internally on PHPStan side.

see comparison of Before vs After Bump to PHPStan 2.1.35

Ref issue reported on PHPStan side:

I will check if we can tweak here, as this got error on this rector-src as well :)

@samsonasik

Copy link
Copy Markdown
MemberAuthor

The PHPStan 2.1.35 cause error in this rector-src unit test as well:

I will check if we can tweak here :)

@samsonasik

Copy link
Copy Markdown
MemberAuthor

@TomasVotruba

TomasVotruba commented Jan 21, 2026

Copy link
Copy Markdown
Member

I've pinned PHPStan 2.1.34 in the composer.json (61f8719) and released a new tag 2.3.3.

It won't fix old installs (as composer rarely downgrades a package), but will prevent next updates

https://github.com/rectorphp/rector/releases/tag/2.3.3

@samsonasik

samsonasik commented Jan 21, 2026

Copy link
Copy Markdown
MemberAuthor

@TomasVotruba thank you, we can temporary add on packages-tests CI.

 - run: | composer install --ansi composer require --dev phpstan/phpstan:2.1.34

as the use of:

composer require rector/rector-src dev-main#${{github.event.pull_request.head.sha}} --no-update

not forcing phpstan 2.1.34.

I will create new PR to temporary pin it so the main branch will all green :)

Ref PR:

@calebdw

Copy link
Copy Markdown
Contributor

Looks like a fix might have been released: phpstan/phpstan#13983 (comment)

So, please, if $scope->getType() doesn't work for you in your isset() rule, use $scope->getScopeType() instead. Thank you for understanding.

@samsonasik

Copy link
Copy Markdown
MemberAuthor

@calebdw I will create separate PR for bump to phpstan ^2.1.36 and verify the fix :)

@samsonasiksamsonasik mentioned this pull request Jan 21, 2026
@samsonasik
samsonasik deleted the bump-phpstan-2135 branch January 21, 2026 14:44
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work.

@github-actionsgithub-actionsBot locked as resolved and limited conversation to collaborators Aug 23, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@samsonasik@TomasVotruba@calebdw