PHPantom version
0.7.0
Installation method
Pre-built binary from GitHub Releases
Operating system
Linux x86_64
Editor
Zed
Bug description
phpantom seems to get confused with inheritance of classes with the same name but different namespaces and ends up wrongly reporting missing methods that are present in the parent class.
Steps to reproduce
- Create this file which is working fine
<?php
namespace Test;
class MyException extends \Exception {}
try {
throw new MyException("foobards");
} catch (MyException $e) {
echo $e->getMessage();
}
- Add a declaration for a class
Test\Exception that should not matter in the rest of the code
<?php
namespace Test;
// add this
class Exception extends \Exception {}
class MyException extends \Exception {}
try {
throw new MyException("foobards");
} catch (MyException $e) {
echo $e->getMessage(); // Method 'getMessage' not found on class 'Test\MyException'
}
PHPantom version
0.7.0
Installation method
Pre-built binary from GitHub Releases
Operating system
Linux x86_64
Editor
Zed
Bug description
phpantom seems to get confused with inheritance of classes with the same name but different namespaces and ends up wrongly reporting missing methods that are present in the parent class.
Steps to reproduce
Test\Exceptionthat should not matter in the rest of the code