PublishSubscribeChannel   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A doSend() 0 8 1
1
<?php
2
3
namespace PEIP\Channel;
4
5
/*
6
 * This file is part of the PEIP package.
7
 * (c) 2009-2016 Timo Michna <timomichna/yahoo.de>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
/**
14
 * PublishSubscribeChannel
15
 * Basic Concrete implementation of a publish-subscribe-channel.
16
 *
17
 * @author Timo Michna <timomichna/yahoo.de>
18
 * @extends \PEIP\ABS\Channel\SubscribableChannel
19
 * @implements \PEIP\INF\Channel\SubscribableChannel, \PEIP\INF\Channel\Channel, \PEIP\INF\Event\Connectable
20
 */
21
class PublishSubscribeChannel extends \PEIP\ABS\Channel\SubscribableChannel
22
{
23
    /**
24
     * Sends a given message on the channel by notifying all subscribers.
25
     *
26
     * @event prePublish
27
     * @event postPublish
28
     *
29
     * @param $message
30
     *
31
     * @return
32
     */
33
    protected function doSend(\PEIP\INF\Message\Message $message)
34
    {
35
        $this->doFireEvent('prePublish', ['MESSAGE' => $message]);
36
        $this->getMessageDispatcher()->notify($message);
37
        $this->doFireEvent('postPublish', ['MESSAGE' => $message]);
38
39
        return true;
40
    }
41
}
42