SiteRepository   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 5
c 1
b 0
f 1
dl 0
loc 15
ccs 0
cts 8
cp 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A findOneByExternalId() 0 6 1
1
<?php
2
3
namespace Loevgaard\DandomainFoundation\Repository;
4
5
use Loevgaard\DandomainFoundation\Entity\Generated\SiteInterface;
0 ignored issues
show
Bug introduced by
The type Loevgaard\DandomainFound...Generated\SiteInterface 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...
6
use Loevgaard\DandomainFoundation\Entity\Site;
7
use Loevgaard\DandomainFoundation\Repository\Generated\SiteRepositoryTrait;
0 ignored issues
show
Bug introduced by
The type Loevgaard\DandomainFound...ted\SiteRepositoryTrait 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|SiteInterface find($id)
12
 * @method SiteInterface[]    findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null)
13
 * @method null|SiteInterface findOneBy(array $criteria)
14
 * @method SiteInterface[]    findAll()
15
 */
16
class SiteRepository extends AbstractRepository
17
{
18
    use SiteRepositoryTrait;
19
20
    public function __construct(RegistryInterface $registry)
21
    {
22
        parent::__construct($registry, Site::class);
0 ignored issues
show
Bug introduced by
$registry of type Symfony\Bridge\Doctrine\RegistryInterface is incompatible with the type Doctrine\Common\Persistence\ManagerRegistry expected by parameter $registry of Loevgaard\DandomainFound...pository::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

22
        parent::__construct(/** @scrutinizer ignore-type */ $registry, Site::class);
Loading history...
23
    }
24
25
    public function findOneByExternalId(int $externalId): ?SiteInterface
26
    {
27
        /** @var SiteInterface $obj */
28
        $obj = $this->_findOneByExternalId($externalId);
29
30
        return $obj;
31
    }
32
}
33