DeleteThreadManager   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A deleteThread() 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\Manager;
12
13
use Miliooo\Messaging\Model\ThreadInterface;
14
use Miliooo\Messaging\Repository\ThreadRepositoryInterface;
15
16
/**
17
 * The delete thread manager is responsible for deleting threads.
18
 *
19
 * @author Michiel Boeckaert <[email protected]>
20
 */
21
class DeleteThreadManager implements DeleteThreadManagerInterface
22
{
23
    /**
24
     * A thread repository instance.
25
     *
26
     * @var ThreadRepositoryInterface
27
     */
28
    protected $threadRepository;
29
30
    /**
31
     * Constructor.
32
     *
33
     * @param ThreadRepositoryInterface $threadRepository A thread repository instance.
34
     */
35
    public function __construct(ThreadRepositoryInterface $threadRepository)
36
    {
37
        $this->threadRepository = $threadRepository;
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function deleteThread(ThreadInterface $thread, $flush = true)
44
    {
45
        $this->threadRepository->delete($thread, $flush);
46
    }
47
}
48