Completed
Pull Request — master (#61)
by Eric
33:00 queued 25:59
created

TranslatableRepository::getLocales()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 10
Ratio 100 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 10
loc 10
ccs 6
cts 6
cp 1
rs 9.4285
cc 2
eloc 5
nc 2
nop 0
crap 2
1
<?php
2
3
/*
4
 * This file is part of the Lug package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Lug\Component\Translation\Repository\Doctrine\ORM;
13
14
use Doctrine\ORM\EntityManager;
15
use Doctrine\ORM\EntityRepository;
16
use Doctrine\ORM\Mapping\ClassMetadata;
17
use Lug\Component\Resource\Model\ResourceInterface;
18
use Lug\Component\Translation\Context\LocaleContextInterface;
19
use Lug\Component\Translation\Repository\TranslatableRepositoryInterface;
20
21
/**
22
 * @author GeLo <[email protected]>
23
 */
24
class TranslatableRepository extends EntityRepository implements TranslatableRepositoryInterface
25
{
26
    use TranslatableRepositoryTrait {
27
        __construct as private constructFromTranslatableRepositoryTrait;
28
    }
29
30
    /**
31
     * @param EntityManager          $em
32
     * @param ClassMetadata          $class
33
     * @param ResourceInterface      $resource
34
     * @param LocaleContextInterface $localeContext
35
     */
36 5
    public function __construct(
37
        $em,
38
        ClassMetadata $class,
39
        ResourceInterface $resource,
40
        LocaleContextInterface $localeContext
41
    ) {
42 5
        $this->constructFromTranslatableRepositoryTrait($em, $class, $resource, $localeContext);
0 ignored issues
show
Unused Code introduced by
The call to TranslatableRepository::...atableRepositoryTrait() has too many arguments starting with $localeContext.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
43 5
    }
44
}
45