InterestedMovieRepository   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 23
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A findOneById() 0 7 1
A findOneByMovieId() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Users\Repository;
6
7
use App\Users\Entity\UserInterestedMovie;
8
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
9
use Symfony\Bridge\Doctrine\RegistryInterface;
10
11
/**
12
 * @method UserInterestedMovie|null find($id, $lockMode = null, $lockVersion = null)
13
 * @method UserInterestedMovie|null findOneBy(array $criteria, array $orderBy = null)
14
 * @method UserInterestedMovie[]    findAll()
15
 * @method UserInterestedMovie[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
16
 */
17
class InterestedMovieRepository extends ServiceEntityRepository
18
{
19 2
    public function __construct(RegistryInterface $registry)
20
    {
21 2
        parent::__construct($registry, UserInterestedMovie::class);
22 2
    }
23
24 2
    public function findOneById(int $interestedMovieId, int $userId): ?UserInterestedMovie
25
    {
26 2
        return $this->findOneBy([
27 2
            'id' => $interestedMovieId,
28 2
            'user' => $userId,
29
        ]);
30
    }
31
32 2
    public function findOneByMovieId(int $movieId, int $userId): ?UserInterestedMovie
33
    {
34 2
        return $this->findOneBy([
35 2
            'movie' => $movieId,
36 2
            'user' => $userId,
37
        ]);
38
    }
39
}
40