Test Failed
Push — main ( 92cbf8...131025 )
by Bingo
08:08
created

resumePreviousVersions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Jabe\Engine\Impl\Repository;
4
5
use Jabe\Engine\Application\ProcessApplicationReferenceInterface;
6
use Jabe\Engine\Impl\RepositoryServiceImpl;
7
use Jabe\Engine\Repository\{
8
    ProcessApplicationDeploymentInterface,
9
    ProcessApplicationDeploymentBuilderInterface,
10
    ResumePreviousBy
11
};
12
13
class ProcessApplicationDeploymentBuilderImpl extends DeploymentBuilderImpl implements ProcessApplicationDeploymentBuilderInterface
14
{
15
    protected $processApplicationReference;
16
    protected $isResumePreviousVersions = false;
17
    protected $resumePreviousVersionsBy = ResumePreviousBy::RESUME_BY_PROCESS_DEFINITION_KEY;
18
19
    public function __construct(RepositoryServiceImpl $repositoryService, ProcessApplicationReferenceInterface $reference)
20
    {
21
        parent::__construct($repositoryService);
22
        $this->processApplicationReference = $reference;
23
        $this->source(ProcessApplicationDeploymentInterface::PROCESS_APPLICATION_DEPLOYMENT_SOURCE);
24
    }
25
26
    public function resumePreviousVersions(): ProcessApplicationDeploymentBuilderInterface
27
    {
28
        $this->isResumePreviousVersions = true;
29
        return $this;
30
    }
31
32
    public function resumePreviousVersionsBy(string $resumePreviousVersionsBy): ProcessApplicationDeploymentBuilderInterface
33
    {
34
        $this->resumePreviousVersionsBy = $resumePreviousVersionsBy;
35
        return $this;
36
    }
37
    // overrides from parent ////////////////////////////////////////////////
38
39
    public function isResumePreviousVersions(): bool
40
    {
41
        return $this->isResumePreviousVersions;
42
    }
43
44
    public function getProcessApplicationReference(): ProcessApplicationReferenceInterface
45
    {
46
        return $this->processApplicationReference;
47
    }
48
49
    public function getResumePreviousVersionsBy(): string
50
    {
51
        return $this->resumePreviousVersionsBy;
52
    }
53
}
54