opencart / opencart

A free shopping cart system. OpenCart is an open source PHP-based online e-commerce solution.

Home Page:https://www.opencart.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[3.0.x.x] phpstan producing different results for the same set of PHP files

mhcwebdesign opened this issue · comments

As per the title: the phpstan tool, when run different times, occasionally produces different results, for the same set of PHP files. Hence when you get [OK] No errors doesn't necessarily mean that there aren't potentially detectable issue!

For example, this one: https://github.com/mhcwebdesign/opencart/actions/runs/7855632559
as opposed to this one: https://github.com/opencart/opencart/actions/runs/7855612207
And running the same level 1 tests on my local test server reports no errors at all for any of the supported PHP versions.

Fix phpstan, or use a different tool altogether!

This only happens if you have classes with identical names and identical methods names but different signatures, and are run PHPStan multi-threaded. And the first part has already been addressed so this no longer happens, the examples you provided are from before that. This issue is just a side effect of what is described in #13663

At the danger of repeating myself: Why don't you address the real phpstan issues here? All what you did was some dirty workarounds for phpstan bugs in OC 3.0.x.x.

You insisting that it's a bug in PHPStan doesn't make it so, you have even gotten a reply from the author that explains why you are seeing the results you are. The workaround was a simple solution compared to trying to make a custom configuration for OC3 where we analyze admin and the shop in two separate runs. Sometimes following a few simple guide lines can save you a lot of trouble. If you feel this strongly that a better solution is needed then I suggest you work on it yourself.

@AJenbo : Agree to disagree. Sorry you can't see phpstan is buggy.