BatchJobDeclaration::resolveExecution()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Jabe\Impl\Batch;
4
5
use Jabe\Impl\Context\Context;
6
use Jabe\Impl\Core\Variable\Mapping\Value\{
7
    ConstantValueProvider,
8
    ParameterValueProviderInterface
9
};
10
use Jabe\Impl\JobExecutor\{
11
    JobDeclaration,
12
    JobHandlerConfigurationInterface
13
};
14
use Jabe\Impl\Persistence\Entity\{
15
    ExecutionEntity,
16
    JobEntity,
17
    MessageEntity
18
};
19
20
class BatchJobDeclaration extends JobDeclaration
21
{
22
    public function __construct(string $jobHandlerType)
23
    {
24
        parent::__construct($jobHandlerType);
25
    }
26
27
    protected function resolveExecution(/*BatchJobContext*/$context): ?ExecutionEntity
28
    {
29
        return null;
30
    }
31
32
    protected function newJobInstance($context = null): JobEntity
33
    {
34
        return new MessageEntity();
35
    }
36
37
    protected function resolveJobHandlerConfiguration(/*BatchJobContext*/$context): JobHandlerConfigurationInterface
38
    {
39
        return new BatchJobConfiguration($context->getConfiguration()->getId());
40
    }
41
42
    protected function resolveJobDefinitionId(/*BatchJobContext*/$context): string
43
    {
44
        return $context->getBatch()->getBatchJobDefinitionId();
45
    }
46
47
    public function getJobPriorityProvider(): ParameterValueProviderInterface
48
    {
49
        $batchJobPriority = Context::getProcessEngineConfiguration()
50
            ->getBatchJobPriority();
0 ignored issues
show
Bug introduced by
The method getBatchJobPriority() does not exist on Jabe\Impl\Cfg\ProcessEngineConfigurationImpl. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

50
            ->/** @scrutinizer ignore-call */ getBatchJobPriority();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
51
        return new ConstantValueProvider($batchJobPriority);
52
    }
53
}
54