AllTranslation   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 20
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 13 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
    /**
11
     * @param array $locales
12
     * @return mixed
13
     */
14 1
    public function get(array $locales)
15
    {
16 1
        $select = ['id', 'group', 'key'];
17
18 1
        foreach ($locales as $locale) {
19 1
            $select[] = "text->$locale as $locale";
20
        }
21
22 1
        return $this->query()
0 ignored issues
show
Bug introduced by
The method select() does not exist on Illuminate\Database\Eloquent\Builder. Did you maybe mean createSelectWithConstraint()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
23 1
            ->select($select)
24 1
            ->paginate()
25 1
            ->toArray();
26
    }
27
}
28