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

ProcessApplicationDeploymentBuilderImpl   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
eloc 14
c 1
b 0
f 0
dl 0
loc 39
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A resumePreviousVersionsBy() 0 4 1
A isResumePreviousVersions() 0 3 1
A getProcessApplicationReference() 0 3 1
A resumePreviousVersions() 0 4 1
A getResumePreviousVersionsBy() 0 3 1
A __construct() 0 5 1
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