-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Drop Psalm in favor of PHPStan #6719
Conversation
b2debc7
to
0fef7ef
Compare
When merging this up, we'll have to be careful to convert existing |
On 3.x, we don't run PHPStan on the tests yet. If we drop Psalm now, we'd lose coverage. 😕 |
run: vendor/bin/psalm --shepherd | ||
|
||
- name: Run type inference tests with Vimeo Psalm | ||
run: vendor/bin/psalm --config=psalm-strict.xml --shepherd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, we should remove type coverage information from the README:
Line 41 in 179e73d
[TypeCov]: https://shepherd.dev/github/doctrine/dbal |
@@ -7,7 +7,7 @@ | |||
|
|||
use function sprintf; | |||
|
|||
/** @psalm-immutable */ | |||
/** @phpstan-immutable */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember that we had to add this annotations to satisfy Psalm. Maybe let's double check what value they provide and, as an option, remove them instead of updating.
*/ | ||
final class CannotCopyStreamToStream extends AbstractException | ||
{ | ||
/** @psalm-param array{message: string}|null $error */ | ||
/** @phpstan-param array{message: string}|null $error */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, at this point it could be just @param
. We use this syntax in @return
annotations in the test data providers a lot.
src/Driver/PgSQL/Statement.php
Outdated
@@ -40,7 +40,7 @@ final class Statement implements StatementInterface | |||
/** @var array<int, mixed> */ | |||
private array $parameters = []; | |||
|
|||
/** @psalm-var array<int, int> */ | |||
/** @phpstan-var array<int, int> */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also could be a @var
.
I'd revisit all Also, what do we do with tracking the usage of deprecated APIs? So far, Psalm was the only tool that we used that provided this tracking, however, in hindsight, it reported the usage of our own APIs in 99.99% of cases, which we use on purpose to establish backward compatibility. I imagine that tracking of deprecated PHP APIs is done via stubs, which may be outdated (i.e. not fully accurate), so it feels like losing this tracking is not a big loss. Am I right? |
As per the decision we made during the hackathon. psalm-immutable annotations have been dropped, as they were only introduced to sastisfy Psalm
In the cases at hand, having an unprefixed phpdoc annotation should not confused any up-to-date IDE.
I'm not sure either, so I removed the syntax you mentioned. We're left with this:
Feel free to request more removals, anybody.
I forgot to set it up, despite that being mentioned here: https://github.com/doctrine/.github/releases/tag/5.2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to request more removals, anybody.
The remaining annotations with the vendor prefix look valid.
Thanks @greg0ire for the cleanup, much awaited.
As per the decision we made during the hackathon.
psalm-immutable annotations
have been dropped, as they were onlyintroduced to sastisfy Psalm
Also, the
phpstan-
prefix has been dropped from some phpdoc annotationwhere I believe it will not confuse any up-to-date IDE.
this means fresher dependencies