UserExtraBettingRepository   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getByUser() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
namespace App\GameExtraBetting\Persistence\Repository;
4
5
use App\GameBetting\Persistence\Entity\UserBetting;
6
use App\GameExtraBetting\Persistence\Entity\UserExtraBetting;
7
use App\User\Persistence\Entity\User;
8
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
9
use Symfony\Bridge\Doctrine\RegistryInterface;
10
use Symfony\Component\Security\Core\User\UserInterface;
11
12
/**
13
 * @method UserExtraBetting|null find($id, $lockMode = null, $lockVersion = null)
14
 * @method UserExtraBetting|null findOneBy(array $criteria, array $orderBy = null)
15
 * @method UserExtraBetting[]    findAll()
16
 * @method UserExtraBetting[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
17
 */
18
class UserExtraBettingRepository extends ServiceEntityRepository
19
{
20
    public function __construct(RegistryInterface $registry)
21
    {
22
        parent::__construct($registry, UserExtraBetting::class);
23
    }
24
25
    /**
26
     * @param UserInterface $user
27
     * @return UserExtraBetting[]
28
     */
29
    public function getByUser(UserInterface $user)
30
    {
31
        return $this->findBy(['user' => $user->getId()]);
0 ignored issues
show
Bug introduced by
The method getId() does not exist on Symfony\Component\Security\Core\User\UserInterface. It seems like you code against a sub-type of Symfony\Component\Security\Core\User\UserInterface such as App\User\Persistence\Entity\User. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

31
        return $this->findBy(['user' => $user->/** @scrutinizer ignore-call */ getId()]);
Loading history...
32
    }
33
}
34