UserRepository   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 3
c 1
b 0
f 0
dl 0
loc 12
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A find() 0 5 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GraphQLTests\Doctrine\Blog\Repository;
6
7
use Doctrine\ORM\EntityRepository;
8
use GraphQLTests\Doctrine\Blog\Model\User;
9
10
/**
11
 * A fake repository so we don't have to set up a DB.
12
 */
13
final class UserRepository extends EntityRepository
14
{
15
    /**
16
     * @param int $id
17
     * @param null|int $lockMode
18
     * @param null|int $lockVersion
19
     */
20
    public function find($id, $lockMode = null, $lockVersion = null): ?User
21
    {
22
        $id = (int) $id;
23
24
        return $id === 123 ? new User($id) : null;
25
    }
26
}
27