DeleteThreadManager::deleteThread()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
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