Locales::getSourceData()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 6
cts 6
cp 1
rs 9.9666
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 2
1
<?php
2
3
namespace Magium\Configuration\Source\Datetime;
4
5
use Magium\Configuration\Source\SourceInterface;
6
7
class Locales implements SourceInterface
8
{
9
10 1
    public function getSourceData()
11
    {
12 1
        $allLocales = [];
13 1
        $locales = \ResourceBundle::getLocales('');
14 1
        foreach ($locales as $locale) {
15 1
            $allLocales[$locale] = \Locale::getDisplayName($locale);
16
        }
17 1
        return $allLocales;
18
    }
19
20
}
21