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

TranslatableRepository::getProperty()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 17
Code Lines 10

Duplication

Lines 17
Ratio 100 %

Code Coverage

Tests 12
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 17
loc 17
ccs 12
cts 12
cp 1
rs 9.4285
cc 3
eloc 10
nc 4
nop 2
crap 3
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\MongoDB;
13
14
use Doctrine\ODM\MongoDB\DocumentManager;
15
use Doctrine\ODM\MongoDB\DocumentRepository;
16
use Doctrine\ODM\MongoDB\Mapping\ClassMetadata;
17
use Doctrine\ODM\MongoDB\UnitOfWork;
18
use Lug\Component\Resource\Model\ResourceInterface;
19
use Lug\Component\Translation\Context\LocaleContextInterface;
20
use Lug\Component\Translation\Repository\TranslatableRepositoryInterface;
21
22
/**
23
 * @author GeLo <[email protected]>
24
 */
25
class TranslatableRepository extends DocumentRepository implements TranslatableRepositoryInterface
26
{
27
    use TranslatableRepositoryTrait {
28
        __construct as private constructFromTranslatableRepositoryTrait;
29
    }
30
31
    /**
32
     * @param DocumentManager        $dm
33
     * @param UnitOfWork             $uow
34
     * @param ClassMetadata          $class
35
     * @param ResourceInterface      $resource
36
     * @param LocaleContextInterface $localeContext
37
     */
38 3
    public function __construct(
39
        DocumentManager $dm,
40
        UnitOfWork $uow,
41
        ClassMetadata $class,
42
        ResourceInterface $resource,
43
        LocaleContextInterface $localeContext
44
    ) {
45 3
        $this->constructFromTranslatableRepositoryTrait($dm, $uow, $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...
46 3
    }
47
}
48