ExistsTranslation   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 17
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A exists() 0 10 1
1
<?php
2
3
namespace Omatech\Mage\Core\Repositories\Translations;
4
5
use Omatech\Mage\Core\Domains\Translations\Contracts\ExistsTranslationInterface;
6
use Omatech\Mage\Core\Domains\Translations\Contracts\TranslationInterface;
7
use Omatech\Mage\Core\Repositories\TranslationBaseRepository;
8
9
class ExistsTranslation extends TranslationBaseRepository implements ExistsTranslationInterface
10
{
11
    /**
12
     * @param TranslationInterface $translation
13
     * @return bool
14
     */
15 19
    public function exists(TranslationInterface $translation): bool
16
    {
17 19
        return $this->query()
0 ignored issues
show
Bug introduced by
The method exists() does not exist on Illuminate\Database\Eloquent\Builder. Did you maybe mean canUseExistsForExistenceCheck()?

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...
18
            ->where(static function ($q) use ($translation) {
19 19
                $q->where('group', $translation->getGroup())
20 19
                  ->where('key', $translation->getKey());
21 19
            })
22 19
            ->orWhere('id', $translation->getId())
23 19
            ->exists();
24
    }
25
}
26