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

TranslateScopeEvent::setTranslation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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