Code Duplication    Length = 12-13 lines in 2 locations

Doctrine/ORM/TenantRepository.php 2 locations

@@ 48-60 (lines=13) @@
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function findOneByDomain($domain)
49
    {
50
        return $this
51
            ->createQueryBuilder('t')
52
            ->select('t', 'o', 'oc')
53
            ->leftJoin('t.organization', 'o')
54
            ->leftJoin('t.outputChannel', 'oc')
55
            ->where('t.domainName = :domainName')
56
            ->andWhere('t.subdomain IS NULL')
57
            ->setParameter('domainName', $domain)
58
            ->getQuery()
59
            ->getOneOrNullResult();
60
    }
61
62
    /**
63
     * {@inheritdoc}
@@ 65-76 (lines=12) @@
62
    /**
63
     * {@inheritdoc}
64
     */
65
    public function findOneByCode($code)
66
    {
67
        return $this
68
            ->createQueryBuilder('t')
69
            ->select('t', 'o')
70
            ->leftJoin('t.organization', 'o')
71
            ->leftJoin('t.outputChannel', 'oc')
72
            ->where('t.code = :code')
73
            ->setParameter('code', $code)
74
            ->getQuery()
75
            ->getOneOrNullResult();
76
    }
77
78
    /**
79
     * {@inheritdoc}