Skip to content

Commit 8ebb61b

Browse files
authored
Merge pull request #158 from keboola/pepa_PS-3697_isLegacyComponent
PS-3697 Get rid of Job::isLegacyComponent, not needed anymore
2 parents b641b50 + d0ca221 commit 8ebb61b

File tree

5 files changed

+0
-33
lines changed

5 files changed

+0
-33
lines changed

src/JobFactory.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,6 @@ public static function getAllowedParallelismValues(): array
102102
return array_merge($intValues, ['infinity', null]);
103103
}
104104

105-
public static function getLegacyComponents(): array
106-
{
107-
return ['orchestrator', 'transformation', 'provisioning'];
108-
}
109-
110105
public function createNewJob(array $data): JobInterface
111106
{
112107
$data = $this->validateJobData($data, NewJobDefinition::class);

src/JobFactory/Job.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,6 @@ private function decryptData($data)
235235
);
236236
}
237237

238-
public function isLegacyComponent(): bool
239-
{
240-
return empty($this->getComponentId()) || in_array($this->getComponentId(), JobFactory::getLegacyComponents());
241-
}
242-
243238
public function getBranchId(): ?string
244239
{
245240
return $this->data['branchId'] ?? null;

src/JobFactory/JobInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public function getBehavior(): Behavior;
3939
public function jsonSerialize(): array;
4040
public function getTokenDecrypted(): string;
4141
public function getConfigDataDecrypted(): array;
42-
public function isLegacyComponent(): bool;
4342
public function getBranchId(): ?string;
4443
public function getVariableValuesId(): ?string;
4544
public function getVariableValuesData(): array;

tests/JobFactory/JobTest.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -195,27 +195,6 @@ public function testHasVariables(): void
195195
self::assertSame(false, $job->hasVariables());
196196
}
197197

198-
public function testIsLegacy(): void
199-
{
200-
self::assertFalse($this->getJob()->isLegacyComponent());
201-
}
202-
203-
public function testIsLegacyOrchestrator(): void
204-
{
205-
$jobData = $this->jobData;
206-
$jobData['componentId'] = 'orchestrator';
207-
self::assertTrue($this->getJob($jobData)->isLegacyComponent());
208-
}
209-
210-
public function testLegacyOrchestratorJob(): void
211-
{
212-
$jobData = $this->jobData;
213-
unset($jobData['componentId']);
214-
$job = $this->getJob($jobData);
215-
self::assertEquals('', $job->getComponentId());
216-
self::assertTrue($job->isLegacyComponent());
217-
}
218-
219198
public function testJsonSerialize(): void
220199
{
221200
$expected = $this->jobData;

tests/JobFactoryTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,6 @@ public function testStaticGetters(): void
526526
{
527527
self::assertCount(5, JobFactory::getFinishedStatuses());
528528
self::assertCount(9, JobFactory::getAllStatuses());
529-
self::assertCount(3, JobFactory::getLegacyComponents());
530529
self::assertCount(3, JobFactory::getKillableStatuses());
531530
}
532531

0 commit comments

Comments
 (0)