CanMessageRecipientSpecification   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isSatisfiedBy() 0 4 1
A getErrorMessage() 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
15
/**
16
 * This specification is responsible for deciding if a given user can send a message to a given recipient.
17
 *
18
 * The default implementation is to just return true.
19
 *
20
 * @author Michiel Boeckaert <[email protected]>
21
 */
22
class CanMessageRecipientSpecification implements CanMessageRecipientInterface
23
{
24
25
    protected $error;
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function isSatisfiedBy(ParticipantInterface $currentParticipant, ParticipantInterface $recipient)
31
    {
32
        return true;
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function getErrorMessage()
39
    {
40
        return $this->error;
41
    }
42
}
43