You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Attributes will work only if you use the Activity and Worker factories from this package.
66
+
35
67
### VirtualPromise interface
36
68
37
69
Every time we use `yield` in a Workflow to wait for an action to complete, a Promise is actually yielded.
38
70
At this point, the IDE and static analyzer usually get lost in type definitions,
39
71
and we experience difficulties and inconveniences because of this.
40
-
However, if the Promise interface had the `@yield` annotation, we could explain to the IDE what type of value we expect to be sent back into the generator from the coroutine.
41
-
Since ReactPHP [isn't yet planning](https://github.com/orgs/reactphp/discussions/536) to add the `@yield` annotation to their promises (Temporal PHP uses ReactPHP promises),
72
+
However, if the Promise interface had the `@yield` annotation,
73
+
we could explain to the IDE what type of value we expect to be sent back into the generator from the coroutine.
74
+
Since ReactPHP [isn't yet planning](https://github.com/orgs/reactphp/discussions/536)
75
+
to add the `@yield` annotation to their promises
76
+
(Temporal PHP uses ReactPHP promises),
42
77
we suggest using our solution for typing - `VirtualPromise`.
43
78
44
79
```php
@@ -69,11 +104,11 @@ class WorkflowClass {
69
104
}
70
105
```
71
106
72
-
> Warning: don't implement the `VirtualPromise` interface yourself, use it only as a type hint.
73
-
74
-
> PHPStorm and Psalm can handle the @yield annotation, but PHPStan can't yet ([issue](https://github.com/phpstan/phpstan/issues/4245)).
107
+
> [!WARNING]
108
+
> don't implement the `VirtualPromise` interface yourself, use it only as a type hint.
75
109
76
-
### Attributes
110
+
> [!NOTE]
111
+
> PHPStorm and Psalm can handle the `@yield` annotation, but PHPStan can't yet ([issue](https://github.com/phpstan/phpstan/issues/4245)).
0 commit comments