TranslationHistoryManager   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 26
rs 10
c 0
b 0
f 0
ccs 5
cts 5
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A createTranslationHistory() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the AsmTranslationLoaderBundle package.
5
 *
6
 * (c) Marc Aschmann <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Asm\TranslationLoaderBundle\Model;
13
14
/**
15
 * Base {@link TranslationHistoryManagerInterface} implementation (can be extended
16
 * by concrete implementations).
17
 *
18
 * @author Christian Flothmann <[email protected]>
19
 */
20
abstract class TranslationHistoryManager implements TranslationHistoryManagerInterface
21
{
22
    /**
23
     * Class implementing the {@link TranslationHistoryInterface} managed by this
24
     * manager
25
     * @var string
26
     */
27
    protected $class;
28
29
    /**
30
     * @param string $class Class name of managed {@link TranslationHistoryInterface}
31
     *                      objects
32
     */
33 3
    public function __construct($class)
34
    {
35 3
        $this->class = $class;
36 3
    }
37
38
    /**
39
     * {@inheritDoc}
40
     */
41 1
    public function createTranslationHistory()
42
    {
43 1
        return new $this->class();
44
    }
45
}
46