Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow PHPStan PHPDoc parser 2.0 #1572

Merged
merged 3 commits into from
Nov 26, 2024

Conversation

ruudk
Copy link
Contributor

@ruudk ruudk commented Nov 21, 2024

Q A
Bug fix? no
New feature? no
Doc updated no
BC breaks? no
Deprecations? no
Tests pass? yes]
Fixed tickets
License MIT

@@ -37,17 +37,18 @@
"require-dev": {
"ext-pdo_sqlite": "*",
"doctrine/annotations": "^1.14 || ^2.0",
"slevomat/coding-standard": "dev-master#f2cc4c553eae68772624ffd7dd99022343b69c31 as 8.11.9999",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

composer.json Outdated
"phpunit/phpunit": "^9.0 || ^10.0 || ^11.0",
"psr/container": "^1.0 || ^2.0",
"rector/rector": "^1.0.0",
"rector/rector": "dev-main#d593c5af24b9ca2da9b7595125dca713f6032bac as 2.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Waiting for a tagged release: rectorphp/rector#8815

@ruudk
Copy link
Contributor Author

ruudk commented Nov 21, 2024

It seems I have opened Pandora's box 🤯

@goetas Could you help out? 🙏

@goetas
Copy link
Collaborator

goetas commented Nov 22, 2024

@ruudk could you clarify which help do you need?

@ruudk ruudk force-pushed the phpstan-phpdoc-parser branch 3 times, most recently from cee194e to c49ce1a Compare November 22, 2024 09:57
@ruudk
Copy link
Contributor Author

ruudk commented Nov 22, 2024

@goetas I guess, I don't need help after all. It wasn't so bad.

@ruudk
Copy link
Contributor Author

ruudk commented Nov 22, 2024

Since these 2 are dev dependencies, would it be possible to pin them like I did now?

Rector will be released on December 12.

I have no idea about slevomat/coding-standard

Then at least we could remove this blocker for others that want to upgrade to PHPStan 2.

/cc @goetas

@ruudk ruudk marked this pull request as ready for review November 22, 2024 18:14
@goetas
Copy link
Collaborator

goetas commented Nov 22, 2024

I have no issue with the changes in the dev dependencies but I ask you kindly to create a new PR with those packages are released.

@scyzoryck art you ok with it?

@@ -26,7 +26,7 @@
"doctrine/instantiator": "^1.3.1 || ^2.0",
"doctrine/lexer": "^2.0 || ^3.0",
"jms/metadata": "^2.6",
"phpstan/phpdoc-parser": "^1.20"
Copy link
Collaborator

@scyzoryck scyzoryck Nov 23, 2024

Choose a reason for hiding this comment

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

I do wonder if we can support both - 1.X & 2.x. Without it people that are using slevomat/coding-standard or rector will be not able to use new version of serializer.
At the moment it is a blocker for me as we need to release some bug for the Union types - but I'm fine with releasing it with only 2.x support after releasing bug fix release - soo we would need to wait ~1 week to merge this one.

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

In theory we can have a hacky if(class_exist(ParserConfig::class)). It will look terrible but most probably it will do the job :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can do that indeed :)

@ruudk ruudk force-pushed the phpstan-phpdoc-parser branch from c49ce1a to 8545895 Compare November 25, 2024 08:19
@ruudk ruudk changed the title Bump PHPStan PHPDoc parser to v2 Allow PHPStan PHPDoc parser 2.0 Nov 25, 2024
@ruudk ruudk requested a review from scyzoryck November 25, 2024 08:19
@ruudk ruudk force-pushed the phpstan-phpdoc-parser branch from 8545895 to 4de1d3c Compare November 25, 2024 08:21
@ruudk ruudk force-pushed the phpstan-phpdoc-parser branch from 4de1d3c to 2380860 Compare November 25, 2024 08:27
@ruudk
Copy link
Contributor Author

ruudk commented Nov 25, 2024

Anybody an idea about these new PHPStan errors?

@samsonasik
Copy link

I think you can exclude Fixtures directory under excludesPaths

parameters:
    # other parameters

    excludePaths:
        - */Fixtures/*

@ruudk ruudk force-pushed the phpstan-phpdoc-parser branch from 03cbe7e to 4b85147 Compare November 25, 2024 09:01
@samsonasik
Copy link

samsonasik commented Nov 25, 2024

You can enable reportUnmatchedIgnoredErrors: false under parameters as different php version show different error:

parameters:
    # other parameters
    reportUnmatchedIgnoredErrors: false

@scyzoryck scyzoryck requested a review from samsonasik November 25, 2024 10:23
@scyzoryck
Copy link
Collaborator

Looks good for me :) I will merge it before the next release.

@scyzoryck scyzoryck merged commit 9bbc691 into schmittjoh:master Nov 26, 2024
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.

4 participants