Skip to content

TASK: PhpStan 2.2 - #3623

Draft
mficzel wants to merge 3 commits into
neos:9.3from
mficzel:task/phpStan_22
Draft

mficzel wants to merge 3 commits into
neos:9.3from
mficzel:task/phpStan_22

Conversation

@mficzel

@mficzel mficzel commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

Upgrade phpstan from ~1.2 to ~2.2 ...

Upgrade instructions

Review instructions

After successfull review, before merge the following adjustments are required:

  • add phpstan ^2.2 constraint t to flow-dev-distribution
  • add phpstan ^2.2 constraint to neos-dev-distribution
  • remove explicit composer require --no-update phpstan/phpstan:"~2.2" from .github/actions/prepare-flow/action.yml

Also note that raising the phpstan requirement to 2.2 will also trigger issues on the neos side that need adjustment at the same time.

Checklist

  • Code follows the PSR-12 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the lowest maintained branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

@mficzel
mficzel force-pushed the task/phpStan_22 branch 5 times, most recently from d39639d to 852602e Compare September 22, 2026 13:19
@mficzel
mficzel force-pushed the task/phpStan_22 branch 4 times, most recently from 61b327e to 5afa147 Compare September 30, 2026 14:09
@mficzel mficzel closed this Sep 30, 2026
@mficzel mficzel reopened this Sep 30, 2026
@mficzel
mficzel marked this pull request as ready for review September 30, 2026 14:50
@mficzel
mficzel force-pushed the task/phpStan_22 branch 5 times, most recently from 72390e7 to b98ef7d Compare September 30, 2026 16:33
@mficzel
mficzel marked this pull request as draft September 30, 2026 16:42
@mficzel

mficzel commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

I made this a draft for now to prevent merging to 9.2 ... this should go to 9.3

@mficzel

mficzel commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

@nezaniel @mhsdesign ... would be great to get preliminary feedback on this. Would like to start working on the Neos side but this only makes sense if the framework changes are kinda final.

With this change and phpstan 2.2 the run un neos yields: "Found 298 errors" :-/

* The current view, as resolved by resolveView()
*
* @var ViewInterface
* @var ViewInterface|null

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this is clearly true it also triggers follow up adjustments.
On the other hand it is not a functional change at all. Just an annotation.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked again and processRequest and callActionMethod handle the case of view beeing null kindoff. I think typing this as ViewInterface|null is the only honest option.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not isset($this->view)

or people should just write $this->view?->assign() in their controller but that sucks too - on the other-hand i dont use views and the action controller anymore at all or i trie as everything is rusty either way

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think $this->view?->assign() is the best way ... but not really elegant

mficzel added a commit to mficzel/neos-development-collection that referenced this pull request Oct 9, 2026
@mficzel
mficzel changed the base branch from 9.2 to 9.3 October 16, 2026 09:31
@mficzel mficzel added 9.3 and removed 9.2 labels Oct 16, 2026
@mficzel mficzel moved this from Todo to In Progress in Neos 9.3 Release Board Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants