UserSettingsRepository   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A findOneByUser() 0 4 1
1
<?php
2
 
3
namespace JhFlexiTime\Repository;
4
 
5
use Doctrine\Common\Persistence\ObjectRepository;
6
use ZfcUser\Entity\UserInterface;
7
8
/**
9
 * Class UserSettingsRepository
10
 * @package JhFlexiTime\Repository
11
 * @author Aydin Hassan <[email protected]>
12
 */
13
class UserSettingsRepository implements UserSettingsRepositoryInterface
14
{
15
 
16
    /**
17
     * @var \Doctrine\Common\Persistence\ObjectRepository
18
     */
19
    protected $userSettingsRepository;
20
21
    /**
22
     * @param ObjectRepository $userSettingsRepository
23
     */
24
    public function __construct(ObjectRepository $userSettingsRepository)
25
    {
26
        $this->userSettingsRepository = $userSettingsRepository;
27
    }
28
29
    /**
30
     * @param UserInterface $user
31
     * @return \JhFlexiTime\Entity\UserSettings
32
     */
33
    public function findOneByUser(UserInterface $user)
34
    {
35
        return $this->userSettingsRepository->findOneBy(['user' => $user]);
36
    }
37
}
38