1 | <?php |
||
17 | abstract class AbstractJobComparisionBusinessCase implements JobComparisonInterface |
||
18 | { |
||
19 | /** |
||
20 | * @var JobRepositoryInterface |
||
21 | */ |
||
22 | protected $oRemoteRepository; |
||
23 | /** |
||
24 | * @var JobRepositoryInterface |
||
25 | */ |
||
26 | protected $oLocalRepository; |
||
27 | /** |
||
28 | * @var DiffCompareInterface |
||
29 | */ |
||
30 | protected $oDiffCompare; |
||
31 | |||
32 | /** |
||
33 | * @inheritdoc |
||
34 | */ |
||
35 | 1 | public function getLocalMissingJobs() |
|
42 | |||
43 | /** |
||
44 | * @inheritdoc |
||
45 | */ |
||
46 | 1 | public function getRemoteMissingJobs() |
|
53 | |||
54 | /** |
||
55 | * @inheritdoc |
||
56 | */ |
||
57 | 1 | public function isJobAvailable($sJobName) |
|
63 | |||
64 | |||
65 | /** |
||
66 | * @param JobCollection $oJobCollectionA |
||
67 | * @param JobCollection $oJobCollectionB |
||
68 | * @return array<string> |
||
|
|||
69 | */ |
||
70 | 2 | protected function getMissingJobsInCollectionA(JobCollection $oJobCollectionA, JobCollection $oJobCollectionB) |
|
77 | |||
78 | 7 | protected function getDifference(JobEntityInterface $oJobEntityA, JobEntityInterface $oJobEntityB) |
|
104 | |||
105 | |||
106 | /** |
||
107 | * @param JobEntityInterface $oJobEntityA |
||
108 | * @param JobEntityInterface $oJobEntityB |
||
109 | * @return array |
||
110 | */ |
||
111 | 7 | protected function compareJobEntities(JobEntityInterface $oJobEntityA, JobEntityInterface $oJobEntityB) |
|
132 | |||
133 | |||
134 | /** |
||
135 | * @inheritdoc |
||
136 | */ |
||
137 | 1 | public function getJobDiff($sJobName) |
|
174 | |||
175 | |||
176 | |||
177 | /** |
||
178 | * @inheritdoc |
||
179 | */ |
||
180 | 6 | public function getLocalJobUpdates() |
|
208 | |||
209 | |||
210 | /** |
||
211 | * This method should perform any operation that is desired before comparing remote and local entities. |
||
212 | * Why this is required? |
||
213 | * For system like marathon, it is essential to set/unset certain values before comparing to make sane |
||
214 | * comparision. |
||
215 | * |
||
216 | * Note: Should be careful with the parameters as they are passed by value. |
||
217 | * |
||
218 | * @param JobEntityInterface $oLocalJob |
||
219 | * @param JobEntityInterface $oRemoteJob |
||
220 | * @return null |
||
221 | */ |
||
222 | abstract protected function preCompareModifications(JobEntityInterface &$oLocalJob, JobEntityInterface &$oRemoteJob); |
||
223 | |||
224 | /** |
||
225 | * Gets entity for each system with defaults set |
||
226 | * @return JobEntityInterface |
||
227 | */ |
||
228 | abstract protected function getEntitySetWithDefaults(); |
||
229 | |||
230 | /** |
||
231 | * Verify if two entities are equal. |
||
232 | * |
||
233 | * @param $sProperty |
||
234 | * @param JobEntityInterface $oJobEntityA |
||
235 | * @param JobEntityInterface $oJobEntityB |
||
236 | * @return mixed |
||
237 | */ |
||
238 | abstract protected function isEntityEqual($sProperty, JobEntityInterface $oJobEntityA, JobEntityInterface $oJobEntityB); |
||
239 | |||
240 | /** |
||
241 | * @param JobEntityInterface $oJobEntityA |
||
242 | * @param JobEntityInterface $oJobEntityB |
||
243 | * @return bool |
||
244 | */ |
||
245 | abstract public function hasSameJobType(JobEntityInterface $oJobEntityA, JobEntityInterface $oJobEntityB); |
||
246 | } |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.