File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 1111
1212namespace Temporal \Client ;
1313
14+ use Doctrine \Common \Annotations \Reader ;
15+ use Spiral \Attributes \AnnotationReader ;
1416use Spiral \Attributes \AttributeReader ;
17+ use Spiral \Attributes \Composite \Composite ;
18+ use Spiral \Attributes \Composite \SelectiveReader ;
19+ use Spiral \Attributes \ReaderInterface ;
1520use Temporal \Client \GRPC \ServiceClientInterface ;
1621use Temporal \DataConverter \DataConverter ;
1722use Temporal \DataConverter \DataConverterInterface ;
@@ -54,7 +59,19 @@ public function __construct(
5459 $ this ->clientOptions = $ options ?? new ClientOptions ();
5560 $ this ->converter = $ converter ?? DataConverter::createDefault ();
5661 $ this ->starter = new WorkflowStarter ($ serviceClient , $ this ->converter , $ this ->clientOptions );
57- $ this ->reader = new WorkflowReader (new AttributeReader ());
62+ $ this ->reader = new WorkflowReader ($ this ->createReader ());
63+ }
64+
65+ /**
66+ * @return ReaderInterface
67+ */
68+ private function createReader (): ReaderInterface
69+ {
70+ if (\interface_exists (Reader::class)) {
71+ return new SelectiveReader ([new AnnotationReader (), new AttributeReader ()]);
72+ }
73+
74+ return new AttributeReader ();
5875 }
5976
6077 /**
You can’t perform that action at this time.
0 commit comments