Skip to content

Phpstan parser#1473

Merged
gennadigennadigennadi merged 9 commits into
deptrac:4.xfrom
patrickkusebauch:phpstan-parser
Oct 13, 2025
Merged

Phpstan parser#1473
gennadigennadigennadi merged 9 commits into
deptrac:4.xfrom
patrickkusebauch:phpstan-parser

Conversation

@patrickkusebauch

Copy link
Copy Markdown
Collaborator

@gennadigennadigennadi

Copy link
Copy Markdown
Collaborator

Is this one ready for review? Do you plan to change something? If not I'll try to find a moment next week and go through the changes.

Changing the minimal php version to 8.2 is necessary, I haven't checked yet? In the past we only dropped support for eol version. 8.1 still gets security fixes till the end of 2025.

@patrickkusebauch

Copy link
Copy Markdown
Collaborator Author

Yes, it is ready for review. The change of minimal version is necessary. It is because of upgrading phpstan/phpdoc-parser to v2 and the related compatibility issues. And I needed to do this upgrade to use the same version as is bundled with phpstan/phpstan so that the connectors to it work properly. Much better version of this upgrade (IMHO) is in #1485. I did just the bare minimum required.

@gennadigennadigennadi gennadigennadigennadi changed the base branch from 4.0.x to 4.x August 2, 2025 10:43
@gennadigennadigennadi

Copy link
Copy Markdown
Collaborator

Could you point me to the compatibility issues or do you have a reproducer at hand? I see phpstan/phpdoc-parser and phpstan/phpstan not requiring php8.2. phpstan-src does requirer php 8.2 but as I understand it gets downgraded to 7.4|8.0 for the bundle version.

Does the issue occur if you use phpstan/phpdoc-parser and phpstan/phpstan and if yes what are the conflicting versions?

@gennadigennadigennadi

Copy link
Copy Markdown
Collaborator

okay something if seen so far is, that phpstan/phpstan-src (2.1.x) requires an explizit phpdoc-parser version (2.2), but phpstan/phpstan does not. So we should be fine with php 8.1?

And if its important for this PR to work correctly, that our phpdoc-parserversion andphpstan/phpstanscopedphpd-parser` are in sync, its just a question of time for deptrac to break (at least this experimental feature). Because we would have to keep track of phpstan dependencies?

@gennadigennadigennadi

Copy link
Copy Markdown
Collaborator

@patrickkusebauch: I just changed the php version from composer.json to 8.1 and everything seems to work well (based on you phpstan-parser branch). The min. php version is not really a blocker, but I'm confused because I don't see were we would need to increase the min. php version yet.

Screenshot 2025-08-12 at 20 25 17

But also this branch needs to resolve its conflicts.

@patrickkusebauch

Copy link
Copy Markdown
Collaborator Author

I am busy for the rest of the week. Will look into it next week.

@patrickkusebauch patrickkusebauch force-pushed the phpstan-parser branch 2 times, most recently from 95aa056 to 42bdaee Compare September 23, 2025 07:46

@patrickkusebauch patrickkusebauch left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ready for review. @gennadigennadigennadi

Comment thread src/DefaultBehavior/Ast/DocParsingHelper.php Outdated
@gennadigennadigennadi

Copy link
Copy Markdown
Collaborator

@patrickkusebauch there seems to be a merge conflict? Could you resolve it and I would merge this PR afterwards.

Comment thread tests/Core/Ast/Parser/NikicTypeResolverTest.php Outdated
Force infection to use at least 8.2 because of incompatibility between the supported PHP versions of the infection plugin and nikic PHP parser.

```
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - infection/infection 0.27.10 requires nikic/php-parser ^4.15.1 -> found nikic/php-parser[v4.15.1, ..., v4.19.4] but it conflicts with your root composer.json require (^5).
    - roave/infection-static-analysis-plugin[1.36.0, ..., 1.39.0] require php ~8.2.0 || ~8.3.0 || ~8.4.0 -> your php version (8.1; overridden via config.platform, actual: 8.3.6) does not satisfy that requirement.
    - roave/infection-static-analysis-plugin 1.35.0 requires infection/infection 0.27.10 -> satisfiable by infection/infection[0.27.10].
    - Root composer.json requires roave/infection-static-analysis-plugin ^1.35 -> satisfiable by roave/infection-static-analysis-plugin[1.35.0, ..., 1.39.0].
```
@patrickkusebauch

Copy link
Copy Markdown
Collaborator Author

@gennadigennadigennadi done. Rebased and merge conflict resolved.

@gennadigennadigennadi gennadigennadigennadi merged commit 9febc25 into deptrac:4.x Oct 13, 2025
19 of 20 checks passed
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.

3 participants