TranslationHistoryManager::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 3
cts 3
cp 1
cc 1
eloc 2
nc 1
nop 1
crap 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