PaymentRepository   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A findOneBySubscriptionId() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PH\Bundle\CoreBundle\Doctrine\ORM;
6
7
use PH\Component\Core\Model\PaymentInterface;
8
use PH\Component\Core\Repository\PaymentRepositoryInterface;
9
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
10
11
class PaymentRepository extends EntityRepository implements PaymentRepositoryInterface
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16
    public function findOneBySubscriptionId(string $paymentId, string $subscriptionId): ?PaymentInterface
17
    {
18
        return $this->createQueryBuilder('o')
19
            ->andWhere('o.id = :paymentId')
20
            ->andWhere('o.subscription = :id')
21
            ->setParameter('paymentId', $paymentId)
22
            ->setParameter('id', $subscriptionId)
23
            ->getQuery()
24
            ->getOneOrNullResult()
25
        ;
26
    }
27
}
28