Failed Conditions
Push — issue#702 ( 91bd46...0b5bf0 )
by Guilherme
19:37 queued 12:15
created

TranslateScopeEvent   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Test Coverage

Coverage 84.62%

Importance

Changes 0
Metric Value
dl 0
loc 51
rs 10
c 0
b 0
f 0
ccs 11
cts 13
cp 0.8462
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A isTranslated() 0 3 1
A getTranslation() 0 3 1
A __construct() 0 4 1
A setTranslation() 0 5 1
A getScope() 0 3 1
1
<?php
2
/**
3
 * This file is part of the login-cidadao project or it's bundles.
4
 *
5
 * (c) Guilherme Donato <guilhermednt on github>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace LoginCidadao\CoreBundle\Event;
12
13
use Symfony\Component\EventDispatcher\Event;
14
15
class TranslateScopeEvent extends Event
16
{
17
    /** @var string */
18
    private $scope;
19
20
    /** @var string */
21
    private $translation;
22
23
    /**
24
     * TranslateScopeEvent constructor.
25
     * @param string $scope
26
     */
27 2
    public function __construct($scope)
28
    {
29 2
        $this->scope = $scope;
30 2
        $this->translation = null;
31 2
    }
32
33
    /**
34
     * @return string
35
     */
36 2
    public function getScope()
37
    {
38 2
        return $this->scope;
39
    }
40
41
    /**
42
     * @return string
43
     */
44 2
    public function getTranslation()
45
    {
46 2
        return $this->translation;
47
    }
48
49
    /**
50
     * @param string $translation
51
     * @return TranslateScopeEvent
52
     */
53 1
    public function setTranslation($translation)
54
    {
55 1
        $this->translation = $translation;
56
57 1
        return $this;
58
    }
59
60
    /**
61
     * @return bool
62
     */
63
    public function isTranslated()
64
    {
65
        return $this->translation !== null;
66
    }
67
}
68