-
-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
Type: BugAn issue causing unintended or problematic behavior.An issue causing unintended or problematic behavior.
Description
🐞 Describe the Bug
When a class implements an interface, it should automatically inherit the @param
s defined in the interface. At least once {@inheritDoc}
is added, but mago analyzer doesn't, which is very inconvenient and contrary to how psalm and phpstan do it
🔄 Steps to Reproduce
. Run
mago anaylze` on my example code
⚙️ Configuration (mago.toml)
-
📜 Command Output
warning[mixed-assignment]: Assigning `mixed` type to a variable may lead to unexpected behavior.
┌─ test.php:11:28
│
11 │ foreach ($x as $int => $string) {
│ ^^^^^^^ Assigning `mixed` type here.
│
= Using `mixed` can lead to runtime errors if the variable is used in a way that assumes a specific type.
= Help: Consider using a more specific type to avoid potential issues.
warning: found 1 issues: 1 warning(s)
📂 PHP Code Sample (If Applicable)
<?php declare(strict_types=1);
interface testInterface {
/** @param array<int,string> $x */
public function test(array $x): void;
}
class testClass implements testInterface {
/** {@inheritDoc} */
public function test(array $x): void {
foreach ($x as $int => $string) {
}
}
}
🖥️ Operating System
Linux
📦 How did you install Mago?
Built from Source
📝 Additional Context
No response
Metadata
Metadata
Assignees
Labels
Type: BugAn issue causing unintended or problematic behavior.An issue causing unintended or problematic behavior.