temporalio / temporalio/sdk-php
[Feature Request] Rename Instance / ActivityInstance / WorkflowInstance to wrappers
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 421
- Forks
- 64
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 11
Description
Is your feature request related to a problem? Please describe.
In InvokeActivity::handle
$context = $context->withInstance($instance->getContext())
This is confusing.
ActivityProtoType::getInstance and ActivityProtoType::withInstance are very confusing because the word "instance" means a different thing in these methods.
Describe the solution you'd like
- Rename
InstancetoInstanceWrapper, same forActivityInstanceandWorkflowInstance. - Rename
ActivityInstance::$contexttoActivityInstanceWrapper::$instance, same forWorkflowInstance.
and change the relevant getters as well. The code above would change to
$context = $context->withInstance($instanceWrapper->getInstance())
That's much more intuitive, isn't it?
ActivityPrototype::getInstance becomes getInstanceWrapper, which, again, I believe to be much more clear.
Additional context
I could submit a PR if this suggestion is something you like.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at InvokeActivity::handle and inspect ActivityProtoType::getInstance, ActivityProtoType::withInstance, ActivityInstance, and WorkflowInstance to map the current instance and context terminology. Done means the requested wrapper names, fields, and relevant getters are updated consistently without changing behavior across their uses.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100