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

Investigate NonStaticSelfCall Psalm issue #792

Closed
JakeQZ opened this issue Oct 4, 2019 · 5 comments
Closed

Investigate NonStaticSelfCall Psalm issue #792

JakeQZ opened this issue Oct 4, 2019 · 5 comments

Comments

@JakeQZ
Copy link
Contributor

JakeQZ commented Oct 4, 2019

See #778 (comment). It seems perhaps that Psalm is sporadically reporting false negatives with the NonStaticSelfCall check enabled. We may need to disable this check in the Psalm config, before Psalm can be included in the Travis CI checks (#790). It may perhaps be the case that this is fixed in a version we can't yet use due to dependency constrainsts (e.g. supporting PHP 7.0).

@JakeQZ JakeQZ mentioned this issue Oct 4, 2019
SignpostMarv added a commit to SignpostMarv/emogrifier that referenced this issue Oct 6, 2019
This commit flags entries in the psalm baseline to be retained, pending
the outcome of MyIntervals#792

regarding: MyIntervals#537, MyIntervals#792, MyIntervals#793
SignpostMarv added a commit to SignpostMarv/emogrifier that referenced this issue Oct 6, 2019
This commit flags entries in the psalm baseline to be retained, pending
the outcome of MyIntervals#792

regarding: MyIntervals#537, MyIntervals#792, MyIntervals#793
SignpostMarv added a commit to SignpostMarv/emogrifier that referenced this issue Oct 7, 2019
This commit flags entries in the psalm baseline to be retained, pending
the outcome of MyIntervals#792

regarding: MyIntervals#537, MyIntervals#792, MyIntervals#793
SignpostMarv added a commit to SignpostMarv/emogrifier that referenced this issue Oct 7, 2019
This commit flags entries in the psalm baseline to be retained, pending
the outcome of MyIntervals#792

regarding: MyIntervals#537, MyIntervals#792, MyIntervals#793
SignpostMarv added a commit to SignpostMarv/emogrifier that referenced this issue Oct 7, 2019
This commit flags entries in the psalm baseline to be retained, pending
the outcome of MyIntervals#792

regarding: MyIntervals#537, MyIntervals#792, MyIntervals#793
SignpostMarv added a commit to SignpostMarv/emogrifier that referenced this issue Oct 7, 2019
This commit flags entries in the psalm baseline to be retained, pending
the outcome of MyIntervals#792

regarding: MyIntervals#537, MyIntervals#792, MyIntervals#793
@JakeQZ
Copy link
Contributor Author

JakeQZ commented Mar 31, 2020

The problem seems to be in the psalm/plugin-phpunit package, which is incorrectly stubbing some static PHPUnit methods as non-static:

https://github.com/psalm/psalm-plugin-phpunit/blob/0.9.1/stubs/Assert.php#L105
https://github.com/psalm/psalm-plugin-phpunit/blob/0.9.1/stubs/Assert.php#L117

@oliverklee
Copy link
Contributor

@JakeQZ Good research! It looks like there's already a PR for this: psalm/psalm-plugin-phpunit#50

@JakeQZ
Copy link
Contributor Author

JakeQZ commented Apr 9, 2020

There's a new release (0.9.2) with the fix, but this would require a later version of Psalm (^3.6.2), which in turn would require a later version of sebastian/diff which is not compatible with PHPUnit 6.x - the latest version that still supports PHP 7.0.

So I would suggest this needs to wait until Emogrifier 5.0 (dropping PHP 7.0 support) to be resolved - unless Phive may be able to help with the dependency problem (we don't need Psalm to be able to run PHPUnit, and we only need to run Psalm against the current-minus-one PHP version). Hence I've set 5.0 Milestone.

Additionally, later versions of Psalm introduce more checks, with additional code issues detected which would need investigating (though the issues reported could be added to the baseline temporarily), so updating Psalm is not a trivial change.

@JakeQZ JakeQZ added this to the 5.0.0 milestone Apr 9, 2020
@oliverklee
Copy link
Contributor

Phive might indeed help.

@oliverklee
Copy link
Contributor

These are all resolved now. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants