Completed
Push — master ( e04814...b7d1bc )
by Joachim
23:14 queued 08:07
created

CategoryRepository::findOneByExternalId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 6
ccs 0
cts 0
cp 0
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Loevgaard\DandomainFoundation\Repository;
4
5
use Loevgaard\DandomainFoundation\Entity\Category;
6
use Loevgaard\DandomainFoundation\Entity\Generated\CategoryInterface;
0 ignored issues
show
Bug introduced by
The type Loevgaard\DandomainFound...rated\CategoryInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use Loevgaard\DandomainFoundation\Repository\Generated\CategoryRepositoryTrait;
0 ignored issues
show
Bug introduced by
The type Loevgaard\DandomainFound...CategoryRepositoryTrait was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Symfony\Bridge\Doctrine\RegistryInterface;
9
10
/**
11
 * @method null|CategoryInterface find($id)
12
 * @method CategoryInterface[]    findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null)
13
 * @method null|CategoryInterface findOneBy(array $criteria)
14
 * @method CategoryInterface[]    findAll()
15
 */
16
class CategoryRepository extends AbstractRepository
17
{
18
    use CategoryRepositoryTrait;
19
20
    public function __construct(RegistryInterface $registry)
21
    {
22
        parent::__construct($registry, Category::class);
23
    }
24
25
    public function findOneByNumber(string $number): ?CategoryInterface
26
    {
27
        /** @var CategoryInterface $obj */
28
        $obj = $this->findOneBy([
29
            'number' => $number,
30
        ]);
31
32
        return $obj;
33
    }
34
35
    public function findOneByExternalId(int $externalId): ?CategoryInterface
36
    {
37
        /** @var CategoryInterface $obj */
38
        $obj = $this->_findOneByExternalId($externalId);
39
40
        return $obj;
41
    }
42
}
43