InboxProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getInboxThreads() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the MilioooMessageBundle package.
5
 *
6
 * (c) Michiel boeckaert <[email protected]>
7
 * This source file is subject to the MIT license that is bundled
8
 * with this source code in the file LICENSE.
9
 */
10
11
namespace Miliooo\Messaging\ThreadProvider\Folder;
12
13
use Miliooo\Messaging\User\ParticipantInterface;
14
use Miliooo\Messaging\Repository\ThreadRepositoryInterface;
15
16
/**
17
 * The inbox provider provides inbox threads for a given participant.
18
 *
19
 * This is an extra layer between the repository
20
 * If you need more logic or alter the logic in the repository you can override this service
21
 *
22
 * @author Michiel Boeckaert <[email protected]>
23
 */
24
class InboxProvider implements InboxProviderInterface
25
{
26
    /**
27
     * A thread repository instance.
28
     *
29
     * @var ThreadRepositoryInterface
30
     */
31
    protected $threadRepository;
32
33
    /**
34
     * Constructor.
35
     *
36
     * @param ThreadRepositoryInterface $threadRepository A threadRepository instance
37
     */
38
    public function __construct(ThreadRepositoryInterface $threadRepository)
39
    {
40
        $this->threadRepository = $threadRepository;
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function getInboxThreads(ParticipantInterface $participant)
47
    {
48
       return $this->threadRepository->getInboxThreadsForParticipant($participant);
49
    }
50
}
51