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
Fix checkbashisms download ans SCA violations #6298
Conversation
sorry, |
@keradus The changed variable |
all PR's are currently failing SCA set, for example: this is because the location:
returns 404 the updated location
works However, since the install script of the SCA exits on the first error it hasn't run all the other tooling, like stan and psalm, either, which is what is the rest of the PR will be about. |
public function offsetSet($index, $token): void | ||
{ | ||
// @phpstan-ignore-next-line as we type checking here |
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.
// @phpstan-ignore-next-line as we type checking here | |
/** @var mixed $token */ |
Also, there's treatPhpDocTypesAsCertain
option in PHPStan configuration, which would prevent it from reporting runtime type checks for variables that are typed in phpdocs, although given that the entire project is statically analyzed, I think turning it off would do more harm than good.
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.
Switching it off on raises a 3 items on this PR, maybe it is worth doing that? Not sure....
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 don't think so. In most methods we trust PHPDoc types. If there are only a few places where we want to validate them at runtime, it's safer to add @var mixed
, as that is how we treat this variable in this case. Switching treatPhpDocTypesAsCertain
off would prevent PHPStan from reporting truly unnecessary checks that are there by mistake.
lets get the PR's green first with this one, than we can refine in others if really needed |
No description provided.