php - How to enable warning for mismatched typehint for method call? -
i have method expecting int
:
/** * @param int $someint */ public function methodexpectingint($someint) { // stuff }
yet when called somewhere when passing object it, warning occur in phpstorm.
/** * @return void */ public function somemethod() { $this->methodexpectingint(23); // no warning int fine $this->methodexpectingint(new \object()); // gets warning in phpstorm \o/ $this->methodexpectingint("this string should issue warning"); // no warning yet string $this->methodexpectingint(null); // no warning yet null $this->methodexpectingint(2.9); // no warning yet float }
it this:
Comments
Post a Comment