UserAgentRepository::find()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
declare(strict_types=1);
3
4
namespace FH\Bundle\UserAgentBundle\Repository;
5
6
use Doctrine\ORM\EntityManagerInterface;
7
use FH\Bundle\UserAgentBundle\Entity\UserAgent;
8
9
/**
10
 * @author Evert Harmeling <[email protected]>
11
 */
12
class UserAgentRepository implements UserAgentRepositoryInterface
13
{
14
    private $entityManager;
15
16
    public function __construct(EntityManagerInterface $entityManager)
17
    {
18
        $this->entityManager = $entityManager;
19
    }
20
21
    public function find(string $version): ?UserAgent
22
    {
23
        return $this->entityManager
24
            ->getRepository(UserAgent::class)
25
            ->find($version);
26
    }
27
}
28