@@ -16,16 +16,17 @@ class OrchestrationJobMatcher
1616{
1717 public function __construct (
1818 private readonly Client $ internalClient ,
19- private readonly ?Components $ componentsApi = null ,
2019 ) {
2120 }
2221
23- public function matchTaskJobsForOrchestrationJob (string $ jobId ): OrchestrationJobMatcherResults
24- {
22+ public function matchTaskJobsForOrchestrationJob (
23+ string $ jobId ,
24+ ?Components $ componentsApi = null ,
25+ ): OrchestrationJobMatcherResults {
2526 $ job = $ this ->internalClient ->getJob ($ jobId );
2627
2728 $ childJobs = $ this ->getOrchestrationTaskJobs ($ job );
28- $ configuration = $ this ->getCurrentOrchestrationConfiguration ($ job );
29+ $ configuration = $ this ->getCurrentOrchestrationConfiguration ($ job, $ componentsApi );
2930 $ this ->validateInputs ($ job , $ configuration );
3031 $ matchedTasks = [];
3132 foreach ($ configuration ['tasks ' ] as $ task ) {
@@ -67,18 +68,18 @@ private function getOrchestrationTaskJobs(JobInterface $job): array
6768 );
6869 }
6970
70- private function getCurrentOrchestrationConfiguration (JobInterface $ job ): array
71+ private function getCurrentOrchestrationConfiguration (JobInterface $ job, ? Components $ componentsApi = null ): array
7172 {
7273 $ configuration = $ job ->getConfigData ();
7374 if ($ configuration ) {
7475 return $ configuration ;
7576 }
7677
7778 // for situations where job token is expired/deleted
78- if ($ this -> componentsApi ) {
79+ if ($ componentsApi ) {
7980 return JobFactory \JobConfigurationResolver::resolveJobConfiguration (
8081 $ job ,
81- $ this -> componentsApi ,
82+ $ componentsApi ,
8283 )['configuration ' ];
8384 }
8485
0 commit comments