Skip to content

TypeSource interface #517

Description

@Firehed

Define Domain\TypeSource\TypeSource — the source-blind interface for resolving typed positions on symbols. Consumers hold this; no consumer sees whether an answer came from a native AST, a docblock, or reflection.

Interface takes symbol identity + which typed position:

  • forFunctionReturn(FunctionName $fn): ?Type
  • forMethodReturn(ClassName $class, MethodName $method): ?Type
  • forParameter(ClassName|FunctionName $owner, ?MethodName $method, string $parameter): ?Type
  • forProperty(ClassName $class, PropertyName $property): ?Type
  • forConstant(ClassName $class, ConstantName $constant): ?Type

Additional for* methods may follow for AST-only positions (catch clauses, variable type-following). Not scope here.

No implementations, no wiring.

Done: src/Domain/TypeSource/TypeSource.php committed; method set covers every typed-declaration position current callers need (see sweep report on sweep/deprecated-factories).


Issue body drafted by AI; reviewed by human.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    MxNDifferent behavior/resolution for the same thing in different contexts

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions