CanMessageRecipientSpecification::isSatisfiedBy()   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\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