Code Duplication    Length = 12-15 lines in 2 locations

Doctrine/ORM/TenantRepository.php 2 locations

@@ 28-42 (lines=15) @@
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function findOneBySubdomainAndDomain($subdomain, $domain)
29
    {
30
        return $this
31
            ->createQueryBuilder('t')
32
            ->select('t', 'o')
33
            ->leftJoin('t.organization', 'o')
34
            ->where('t.subdomain = :subdomain')
35
            ->andWhere('t.domainName = :domainName')
36
            ->setParameters([
37
                'subdomain' => $subdomain,
38
                'domainName' => $domain,
39
            ])
40
            ->getQuery()
41
            ->getOneOrNullResult();
42
    }
43
44
    /**
45
     * {@inheritdoc}
@@ 47-58 (lines=12) @@
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function findOneByDomain($domain)
48
    {
49
        return $this
50
            ->createQueryBuilder('t')
51
            ->select('t', 'o')
52
            ->leftJoin('t.organization', 'o')
53
            ->where('t.domainName = :domainName')
54
            ->andWhere('t.subdomain IS NULL')
55
            ->setParameter('domainName', $domain)
56
            ->getQuery()
57
            ->getOneOrNullResult();
58
    }
59
60
    /**
61
     * {@inheritdoc}