vimeo/psalm
Psalm is a powerful PHP static analysis tool that finds type errors and bugs before runtime. Install via Composer, configure for your codebase, and run it locally or try the live demo at psalm.dev. Docs and integrations available for teams and CI.
Emitted when trying to call a method on a value that may not be an object
<?php
class A {
public function bar() : void {}
}
/** [@return](https://github.com/return) A|int */
function foo() {
return rand(0, 1) ? new A : 5;
}
foo()->bar();
How can I help you explore Laravel packages today?