Locale::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 4
dl 0
loc 6
ccs 5
cts 5
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace CodeZero\BrowserLocale;
4
5
class Locale
6
{
7
    /**
8
     * Full locale with language and optional country code.
9
     *
10
     * @var string
11
     */
12
    public $locale;
13
14
    /**
15
     * Language code of the locale.
16
     *
17
     * @var string
18
     */
19
    public $language;
20
21
    /**
22
     * Country code of the locale, if available.
23
     *
24
     * @var string
25
     */
26
    public $country;
27
28
    /**
29
     * An indicator of importance, where 1.0 is most
30
     * important and 0.0 is least important.
31
     *
32
     * @var float
33
     */
34
    public $weight;
35
36
    /**
37
     * Create a new Locale instance.
38
     *
39
     * @param string $locale
40
     * @param string $language
41
     * @param string $country
42
     * @param float $weight
43
     */
44 8
    public function __construct($locale, $language, $country, $weight)
45
    {
46 8
        $this->locale = $locale;
47 8
        $this->language = $language;
48 8
        $this->country = $country;
49 8
        $this->weight = $weight;
50 8
    }
51
}
52