Completed
Push — develop ( 8109ce...b15e90 )
by Alejandro
17s queued 12s
created

DomainService   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A listDomainsWithout() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Shlinkio\Shlink\Core\Domain;
6
7
use Doctrine\ORM\EntityManagerInterface;
8
use Shlinkio\Shlink\Core\Domain\Repository\DomainRepositoryInterface;
9
use Shlinkio\Shlink\Core\Entity\Domain;
10
11
class DomainService implements DomainServiceInterface
12
{
13
    private EntityManagerInterface $em;
14
15 5
    public function __construct(EntityManagerInterface $em)
16
    {
17 5
        $this->em = $em;
18 5
    }
19
20
    /**
21
     * @return Domain[]
22
     */
23 5
    public function listDomainsWithout(?string $excludeDomain = null): array
24
    {
25
        /** @var DomainRepositoryInterface $repo */
26 5
        $repo = $this->em->getRepository(Domain::class);
27 5
        return $repo->findDomainsWithout($excludeDomain);
28
    }
29
}
30