Translation   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 82
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A path() 0 4 1
A language() 0 4 1
A domain() 0 4 1
A type() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of slick/i18n package
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Slick\I18n;
11
12
/**
13
 * Translation
14
 *
15
 * @package Slick\I18n
16
 */
17
class Translation
18
{
19
20
    const TYPE_PHP_ARRAY = 'phparray';
21
    const TYPE_GETTEXT   = 'gettext';
22
23
    /**
24
     * @var Language
25
     */
26
    private $language;
27
28
    /**
29
     * @var string
30
     */
31
    private $path;
32
33
    /**
34
     * @var string
35
     */
36
    private $domain;
37
38
    /**
39
     * @var string
40
     */
41
    private $type;
42
43
    /**
44
     * Creates a Translation
45
     *
46
     * @param Language $language
47
     * @param string   $path
48
     * @param string   $domain
49
     * @param string   $type
50
     */
51
    public function __construct(Language $language, $path, $domain = 'messages', $type = self::TYPE_PHP_ARRAY)
52
    {
53
        $this->language = $language;
54
        $this->path = $path;
55
        $this->domain = $domain;
56
        $this->type = $type;
57
    }
58
59
    /**
60
     * Translation messages path
61
     *
62
     * @return string
63
     */
64
    public function path()
65
    {
66
        return $this->path;
67
    }
68
69
    /**
70
     * Translation language
71
     *
72
     * @return Language
73
     */
74
    public function language()
75
    {
76
        return $this->language;
77
    }
78
79
    /**
80
     * Translation domain
81
     *
82
     * @return string
83
     */
84
    public function domain()
85
    {
86
        return $this->domain;
87
    }
88
89
    /**
90
     * Translation type
91
     *
92
     * @return string
93
     */
94
    public function type()
95
    {
96
        return $this->type;
97
    }
98
}