SimpleSaveAggregateCallback   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A save() 0 5 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\Repository;
10
11
use Governor\Framework\Domain\AggregateRootInterface;
12
use Governor\Framework\UnitOfWork\SaveAggregateCallbackInterface;
13
14
/**
15
 * Description of SimpleSaveAggregateCallback
16
 *
17
 * @author david
18
 */
19
class SimpleSaveAggregateCallback implements SaveAggregateCallbackInterface
20
{
21
22
    private $closure;
23
24 25
    public function __construct(\Closure $closure)
25
    {
26 25
        $this->closure = $closure;
27 25
    }
28
29 9
    public function save(AggregateRootInterface $aggregate)
30
    {
31 9
        $cb = $this->closure;
32 9
        $cb($aggregate);
33 9
    }
34
35
}
36