Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
AbstractTaskSetFilter | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
copyValidAndInvalidTasksToNewTaskSet | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace GrowthExperiments\NewcomerTasks; |
4 | |
5 | use GrowthExperiments\NewcomerTasks\Task\TaskSet; |
6 | |
7 | /** |
8 | * Base class with a helper method to copy valid/invalid TaskSet data into a new TaskSet. |
9 | */ |
10 | abstract class AbstractTaskSetFilter implements TaskSetFilter { |
11 | |
12 | /** |
13 | * @param TaskSet $taskSet |
14 | * @param array $validTasks |
15 | * @param array $invalidTasks |
16 | * @return TaskSet |
17 | */ |
18 | public function copyValidAndInvalidTasksToNewTaskSet( |
19 | TaskSet $taskSet, array $validTasks, array $invalidTasks |
20 | ): TaskSet { |
21 | $filteredTaskSet = new TaskSet( |
22 | $validTasks, |
23 | $taskSet->getTotalCount(), |
24 | $taskSet->getOffset(), |
25 | $taskSet->getFilters(), |
26 | $invalidTasks |
27 | ); |
28 | $filteredTaskSet->setDebugData( $taskSet->getDebugData() ); |
29 | $filteredTaskSet->setQualityGateConfig( $taskSet->getQualityGateConfig() ); |
30 | return $filteredTaskSet; |
31 | } |
32 | |
33 | } |