-
Within a certain class file, I have the following lines:
Note that the 1st and 5th lines both refer to $this->id_prefix. When I run PHPStan, it generates an error: What's going on that it acknowledges the legitimacy of the first reference, but not the second? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Please reproduce your issue at phpstan.org and share the link, thanks. |
Beta Was this translation helpful? Give feedback.
-
Interestingly, I cannot reproduce it on the site. I'm running PHPStan (0.12.64) against several directories of files within my codebase, and bootstrapping a bunch of stuff, so the errors between my execution and those on phpstan.org are quite different. The particular error that concerns me does not appear on phpstan.org. I have two bootstrap files and 7 directories in my config path (phpstan.neon). If I remove those, I get 70+ errors, similar to phpstan.org, and I do not get the Somehow, the error is the result of parsing more than just the single file. I can make the error disappear in one of two ways:
So I'm not sure what's going on, nor why one reference to And I don't want to waste your support time on a very specific anomaly, but if you think of anything, let me know! In the meantime, I'll continue working to remove all the errors (370 to go!) to see if there is some cumulative effect responsible. I have noticed that PHPStan returns results in a slightly strange manner if it encounters a single parse error in any of the many files in my scans. But...thanks for making this, too! More work for me, but better software! |
Beta Was this translation helpful? Give feedback.
Interestingly, I cannot reproduce it on the site. I'm running PHPStan (0.12.64) against several directories of files within my codebase, and bootstrapping a bunch of stuff, so the errors between my execution and those on phpstan.org are quite different. The particular error that concerns me does not appear on phpstan.org.
I have two bootstrap files and 7 directories in my config path (phpstan.neon). If I remove those, I get 70+ errors, similar to phpstan.org, and I do not get the
undefined property
error.Somehow, the error is the result of parsing more than just the single file.
I can make the error disappear in one of two ways:
if
wrapper around the line containi…