Skip to content

Don't fully-qualify "static" as a return type - #77

Merged
janlam7 merged 1 commit into
hostnet:masterfrom
janlam7:fix/static-return-type-qualification
Sep 14, 2026
Merged

Don't fully-qualify "static" as a return type#77
janlam7 merged 1 commit into
hostnet:masterfrom
janlam7:fix/static-return-type-qualification

Conversation

@janlam7

@janlam7 janlam7 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

ReflectionType::getName() qualified any type not in NON_QUALIFIED_TYPES with a leading backslash, but "static" is a reserved word, not a class name — emitting "\static" as a generated interface method's return type is invalid PHP ("'\static' is an invalid class name").

Triggered by having static as return-type in https://github.com/hostnet/entity-blamable-component/blob/master/src/BlamableInterface.php

ReflectionType::getName() qualified any type not in NON_QUALIFIED_TYPES
with a leading backslash, but "static" is a reserved word, not a class
name — emitting "\static" as a generated interface method's return
type is invalid PHP ("'\static' is an invalid class name").

Add "static" to NON_QUALIFIED_TYPES alongside "self". Surfaced by
HNB-3627: hostnet/entity-blamable-component 2.0.0 widened
BlamableInterface's setters to "static" return types, so any entity
implementing it and going through entity-plugin-lib's combined
interface generator hit this.
@janlam7 janlam7 self-assigned this Sep 14, 2026
@janlam7
janlam7 merged commit 1c9cb38 into hostnet:master Sep 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant