AnnotatedCommandHandler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 1 Features 1
Metric Value
wmc 2
c 4
b 1
f 1
lcom 1
cbo 1
dl 0
loc 24
ccs 7
cts 7
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A handle() 0 7 1
1
<?php
2
3
/*
4
 * To change this license header, choose License Headers in Project Properties.
5
 * To change this template file, choose Tools | Templates
6
 * and open the template in the editor.
7
 */
8
9
namespace Governor\Framework\CommandHandling\Handlers;
10
11
use Governor\Framework\CommandHandling\CommandMessageInterface;
12
use Governor\Framework\UnitOfWork\UnitOfWorkInterface;
13
use Governor\Framework\Common\ParameterResolverFactoryInterface;
14
15
/**
16
 * Description of GenericCommandHandler
17
 *
18
 * @author david
19
 */
20
class AnnotatedCommandHandler extends AbstractAnnotatedCommandHandler
21
{
22
23
    /**
24
     * @var mixed
25
     */
26
    private $target;
27
28 4
    public function __construct($className, $methodName,
29
            ParameterResolverFactoryInterface $parameterResolver, $target)
30
    {
31 4
        parent::__construct(get_class($target), $methodName, $parameterResolver);
32 4
        $this->target = $target;
33 4
    }
34
35 3
    public function handle(CommandMessageInterface $commandMessage,
36
            UnitOfWorkInterface $unitOfWork)
37
    {
38 3
        $arguments = $this->resolveArguments($commandMessage);
39
40 3
        return $this->getMethod()->invokeArgs($this->target, $arguments);
41
    }
42
43
}
44