Passed
Push — master ( a569b2...1b7ab6 )
by Christian
03:49
created

AllTranslation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 8
c 1
b 1
f 0
dl 0
loc 14
ccs 8
cts 8
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 12 2
1
<?php
2
3
namespace Omatech\Mage\Core\Repositories\Translations;
4
5
use Omatech\Mage\Core\Domains\Translations\Contracts\AllTranslationInterface;
6
use Omatech\Mage\Core\Repositories\TranslationBaseRepository;
7
8
class AllTranslation extends TranslationBaseRepository implements AllTranslationInterface
9
{
10 1
    public function get($locales)
11
    {
12 1
        $select = ['id', 'group', 'key'];
13
14 1
        foreach ($locales as $locale) {
15 1
            $select[] = "text->$locale as $locale";
16
        }
17
18 1
        return $this->query()
19 1
            ->select($select)
20 1
            ->paginate()
21 1
            ->toArray();
22
    }
23
}
24