CanDeleteThreadSpecification   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A isSatisfiedBy() 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\Specifications;
12
13
use Miliooo\Messaging\User\ParticipantInterface;
14
use Miliooo\Messaging\Model\ThreadInterface;
15
16
/**
17
 * CanDeleteThreadSpecification.
18
 *
19
 * The can delete thread specification is responsible for deciding if a given participant can delete a thread.
20
 *
21
 * Since we don't want messages to suddenly disappear for a given user the default implementation
22
 * is to always return false. Also we are not aware about how to check a certain user role. So checking for role_admin
23
 * is something we can't rely on since it's not part of the participantInterface
24
 *
25
 * @author Michiel Boeckaert <[email protected]>
26
 */
27
class CanDeleteThreadSpecification
28
{
29
    /**
30
     * Checks if the given participant can delete the given thread.
31
     *
32
     * @param ParticipantInterface $participant The user that we check for
33
     * @param ThreadInterface      $thread      The thread that we check
34
     *
35
     * @return boolean true if participant can delete the thread, false otherwise.
36
     */
37
    public function isSatisfiedBy(ParticipantInterface $participant, ThreadInterface $thread)
0 ignored issues
show
Unused Code introduced by
The parameter $participant is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $thread is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
38
    {
39
        return false;
40
    }
41
}
42