Completed
Push — master ( 684ae8...291909 )
by Vladimir
03:40
created

LanguageHelper::getLocales()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * @link https://github.com/yiimaker/yii2-email-templates
4
 * @copyright Copyright (c) 2017 Yii Maker
5
 * @license BSD 3-Clause License
6
 */
7
8
namespace ymaker\email\templates\helpers;
9
10
use Yii;
11
use motion\i18n\LanguageProviderInterface;
12
13
/**
14
 * Language helper.
15
 *
16
 * @author Vladimir Kuprienko <[email protected]>
17
 * @since 3.0
18
 */
19
class LanguageHelper
20
{
21
    /**
22
     * Returns languages locales list.
23
     *
24
     * @return array
25
     */
26
    public static function getLocales()
27
    {
28
        /* @var LanguageProviderInterface $languageProvider */
29
        $languageProvider = Yii::$container->get(LanguageProviderInterface::class);
30
        return array_column($languageProvider->getLanguages(), 'locale');
31
    }
32
}
33