TranslationEvent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 27
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 getTranslation() 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\Event;
13
14
use Asm\TranslationLoaderBundle\Model\TranslationInterface;
15
use Symfony\Component\EventDispatcher\Event;
16
17
/**
18
 * Event that is triggered through a {@link TranslationInterface translation's}
19
 * lifecycle.
20
 *
21
 * @author Christian Flothmann <[email protected]>
22
 */
23
class TranslationEvent extends Event
24
{
25
    const POST_PERSIST = 'postPersist';
26
    const POST_UPDATE = 'postUpdate';
27
    const POST_REMOVE = 'postRemove';
28
29
    /**
30
     * @var TranslationInterface
31
     */
32
    private $translation;
33
34
    /**
35
     * @param TranslationInterface $translation
36
     */
37 11
    public function __construct(TranslationInterface $translation)
38
    {
39 11
        $this->translation = $translation;
40 11
    }
41
42
    /**
43
     * @return TranslationInterface
44
     */
45 6
    public function getTranslation()
46
    {
47 6
        return $this->translation;
48
    }
49
}
50