Skip to content

Fix: fully-qualify \Closure in docblock type hints for correct reflection-copy resolution - #59

Open
bolivir wants to merge 2 commits into
Codeception:mainfrom
bolivir:main
Open

bolivir wants to merge 2 commits into
Codeception:mainfrom
bolivir:main

Conversation

@bolivir

@bolivir bolivir commented Aug 26, 2026

Copy link
Copy Markdown

Fully qualify the type inline as \Closure in all three docblocks. Because the qualification lives in the docblock text itself, it survives being copied verbatim into any consumer's generated actor class — resolving correctly regardless of that file's namespace or its own imports.

…tion-copy resolution

Fully qualify the type inline as `\Closure` in all three docblocks. Because the qualification lives in the docblock text itself, it survives being copied verbatim into any consumer's generated actor class — resolving correctly regardless of that file's namespace or its own imports.
@JaZo

JaZo commented Sep 24, 2026 •

Copy link
Copy Markdown

Great fix! Unfortunately the Closure is not the only issue; there are more non-imported classes in the generated actor class:

  • EloquentModel
  • EloquentCollection
  • RuntimeException

…es in public docblocks

Docblocks of public module methods are copied verbatim into consumers' generated actor classes, where aliased or unqualified imports (EloquentModel, EloquentCollection, RuntimeException, Authenticatable) do not resolve. Fully qualify them inline, and drop the now-unused EloquentCollection import.
@bolivir

bolivir commented Oct 6, 2026

Copy link
Copy Markdown
Author

Thanks! Fully qualified EloquentModel, EloquentCollection and RuntimeException in the public InteractsWithEloquent docblocks, and also Authenticatable in amLoggedAs, which had the same issue. The remaining unqualified names are only on hook/protected/private methods, which aren't copied into the actor.

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.

4 participants