2323
2424use fiftyone \pipeline \core \BasicListEvidenceKeyFilter ;
2525use fiftyone \pipeline \core \ElementDataDictionary ;
26+ use fiftyone \pipeline \core \FlowData ;
2627use fiftyone \pipeline \core \FlowElement ;
2728
2829// Two simple FlowElements
2930
3031class ExampleFlowElementA extends FlowElement
3132{
32- public $ dataKey = 'example1 ' ;
33+ public string $ dataKey = 'example1 ' ;
3334
34- public $ properties = [
35+ public array $ properties = [
3536 'exampleProperty1 ' => [
3637 'type ' => 'int '
3738 ]
3839 ];
3940
40- public function processInternal ($ flowData )
41+ public function processInternal (FlowData $ flowData ): void
4142 {
4243 $ data = new ElementDataDictionary ($ this , ['exampleProperty1 ' => 5 ]);
4344
4445 $ flowData ->setElementData ($ data );
4546 }
4647
47- public function getEvidenceKeyFilter ()
48+ public function getEvidenceKeyFilter (): BasicListEvidenceKeyFilter
4849 {
4950 return new BasicListEvidenceKeyFilter (['header.user-agent ' ]);
5051 }
5152}
5253
5354class ExampleFlowElementB extends FlowElement
5455{
55- public $ dataKey = 'example2 ' ;
56+ public string $ dataKey = 'example2 ' ;
5657
57- public $ properties = [
58+ public array $ properties = [
5859 'exampleProperty2 ' => [
5960 'type ' => 'int '
6061 ]
6162 ];
6263
63- public function processInternal ($ flowData )
64+ public function processInternal (FlowData $ flowData ): void
6465 {
6566 $ data = new ElementDataDictionary ($ this , ['exampleProperty2 ' => 7 ]);
6667
6768 $ flowData ->setElementData ($ data );
6869 }
6970
70- public function getEvidenceKeyFilter ()
71+ public function getEvidenceKeyFilter (): BasicListEvidenceKeyFilter
7172 {
7273 return new BasicListEvidenceKeyFilter (['header.user-agent ' ]);
7374 }
@@ -78,14 +79,14 @@ public function getEvidenceKeyFilter()
7879
7980 class ErrorFlowElement extends FlowElement
8081 {
81- public $ dataKey = 'error ' ;
82+ public string $ dataKey = 'error ' ;
8283
83- public function processInternal ($ flowData )
84+ public function processInternal (FlowData $ flowData ): void
8485 {
8586 throw new Exception ('Something went wrong ' );
8687 }
8788
88- public function getEvidenceKeyFilter ()
89+ public function getEvidenceKeyFilter (): BasicListEvidenceKeyFilter
8990 {
9091 return new BasicListEvidenceKeyFilter (['header.user-agent ' ]);
9192 }
@@ -97,14 +98,14 @@ public function getEvidenceKeyFilter()
9798
9899 class StopFlowElement extends FlowElement
99100 {
100- public $ dataKey = 'stop ' ;
101+ public string $ dataKey = 'stop ' ;
101102
102- public function processInternal ($ flowData )
103+ public function processInternal (FlowData $ flowData ): void
103104 {
104105 $ flowData ->stop ();
105106 }
106107
107- public function getEvidenceKeyFilter ()
108+ public function getEvidenceKeyFilter (): BasicListEvidenceKeyFilter
108109 {
109110 return new BasicListEvidenceKeyFilter (['header.user-agent ' ]);
110111 }
0 commit comments