Add static to isBuiltin() check in ide-helper:models (#1541)

* Add `\\static` as check

For some reason, the `static` keyword as a return type, does not return `isBuiltin()` === true, so a `\\` is added. We need to manually add it to the built in check.

* Update ModelsCommand.php

* Add tests

* Add CHANGELOG.md entry

---------

Co-authored-by: Markus Podar <[email protected]>
Co-authored-by: Barry vd. Heuvel <[email protected]>
This commit is contained in:
Bram
2024-07-12 16:08:08 +02:00
committed by GitHub
co-authored by Markus Podar Barry vd. Heuvel
parent f7a3dc8ff2
commit f5759e2001
5 changed files with 26 additions and 1 deletions
+1 -1
View File
@@ -1633,7 +1633,7 @@ class ModelsCommand extends Command
protected function getReflectionNamedType(ReflectionNamedType $paramType): string
{
$parameterName = $paramType->getName();
if (!$paramType->isBuiltin()) {
if (!$paramType->isBuiltin() && $paramType->getName() !== 'static') {
$parameterName = '\\' . $parameterName;
}