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

Only shows InvalidDocblock error on first run #763

Closed
still-dreaming-1 opened this issue May 21, 2018 · 1 comment
Closed

Only shows InvalidDocblock error on first run #763

still-dreaming-1 opened this issue May 21, 2018 · 1 comment
Labels

Comments

@still-dreaming-1
Copy link
Contributor

still-dreaming-1 commented May 21, 2018

At first I had InvalidDocblock setup in my config as errorLevel="info". It found a problem and displayed the issue the first time I ran psalm. If I ran it again, it no longer showed that problem, even though the problem still exists. I tried changing the errorLevel to "error", but it is still not showing the problem.

A more detailed rundown of what I tried: I initially noticed the problem in psalm 1.1.4. I then updated to 2.0. At that point, the first time I ran it, it showed the issue in my code again. I ran it again, and it would not show the problem. I changed the error level to error, and ran it again, but it still did not show the problem.

The problem it found in my docblock is I specified the type of a private property, but did so as if calling a constructor by including the parenthesis. Here are the 2 lines of code causing the issue inside a class.
/** @var \Acs\Csst\Data\Database\Tables\SystemStateTable() */
private $systemStateTable;

Here is the error message it shows me when it does find the problem:

INFO: InvalidDocblock - src/Csst/Library/ExceptionHandlerTest.php:9:5 - Acs\Csst\Data\Database\Tables\SystemStateTable() is not a valid type
    /** @var \Acs\Csst\Data\Database\Tables\SystemStateTable() */
    private $systemStateTable;
@muglug muglug added the bug label May 21, 2018
@muglug
Copy link
Collaborator

muglug commented May 21, 2018

Thanks for ticketing. You can work around this issue (only showing the error once) for the moment by running Psalm with the --no-cache flag.

@muglug muglug closed this as completed in 14f3f7a May 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants