allow plugin to continue operating if assert() is non-fatal#47
allow plugin to continue operating if assert() is non-fatal#47SignpostMarv wants to merge 2 commits intopsalm:masterfrom
assert() is non-fatal#47Conversation
48c8a06 to
e6510aa
Compare
|
incidentally, this looks like it closes #32 |
|
I think the issue should be addressed by removing the assert and dealing with the situation that causes failure (and for that we need a reproducer, as was requested in #32 (comment)), rather than trying to work it around. Ideally we should not modify Psalm-inferred types in the plugin, so it's better to |
|
|
In some environments,
assert()can be configured to be non-fatal, which causes the plugin to error out when$param->typeis passed to a function that expectsType\Union.Setting the type via
Type::getMixed()(being the equivalent of "unknown" in this particular case) allows the plugin to continue executing, while the assertion still gets logged.When assertions are fatal, no change in behaviour is expected as the plugin should bail out right away.