AbstractTaskDefinitionDispatcher   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 24
ccs 0
cts 8
cp 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setDispatcherFinder() 0 3 1
A delegate() 0 4 1
1
<?php
2
3
namespace Deployee\Plugins\Deploy\Dispatcher;
4
5
use Deployee\Plugins\Deploy\Definitions\Tasks\TaskDefinitionInterface;
6
7
abstract class AbstractTaskDefinitionDispatcher implements TaskDefinitionDispatcherInterface
8
{
9
    /**
10
     * @var DispatcherFinder
11
     */
12
    protected $dispatcherFinder;
13
14
    /**
15
     * @param DispatcherFinder $dispatcherFinder
16
     */
17
    public function setDispatcherFinder(DispatcherFinder $dispatcherFinder)
18
    {
19
        $this->dispatcherFinder = $dispatcherFinder;
20
    }
21
22
    /**
23
     * @param TaskDefinitionInterface $taskDefinition
24
     * @return DispatchResultInterface
25
     * @throws \Deployee\Plugins\Deploy\Exception\DispatcherException
26
     */
27
    protected function delegate(TaskDefinitionInterface $taskDefinition): DispatchResultInterface
28
    {
29
        $dispatcher = $this->dispatcherFinder->findTaskDispatcherByDefinition($taskDefinition);
30
        return $dispatcher->dispatch($taskDefinition);
31
    }
32
}