Completed
Push — issue#666 ( 928a8e...2654e9 )
by Guilherme
04:24
created

TranslateScopeEvent   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 53
rs 10
c 0
b 0
f 0
wmc 5
lcom 1
cbo 1

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getScope() 0 4 1
A getTranslation() 0 4 1
A setTranslation() 0 6 1
A isTranslated() 0 4 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
    public function __construct($scope)
28
    {
29
        $this->scope = $scope;
30
        $this->translation = null;
31
    }
32
33
    /**
34
     * @return string
35
     */
36
    public function getScope()
37
    {
38
        return $this->scope;
39
    }
40
41
    /**
42
     * @return string
43
     */
44
    public function getTranslation()
45
    {
46
        return $this->translation;
47
    }
48
49
    /**
50
     * @param string $translation
51
     * @return TranslateScopeEvent
52
     */
53
    public function setTranslation($translation)
54
    {
55
        $this->translation = $translation;
56
57
        return $this;
58
    }
59
60
    /**
61
     * @return bool
62
     */
63
    public function isTranslated()
64
    {
65
        return $this->translation !== null;
66
    }
67
}
68