Wiretap::doReply()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 3 Features 0
Metric Value
c 3
b 3
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace PEIP\Listener;
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
 * Wiretap
15
 *
16
 * @author Timo Michna <timomichna/yahoo.de>
17
 * @package PEIP
18
 * @subpackage listener
19
 * @extends \PEIP\Pipe\FixedEventPipe
20
 * @implements \PEIP\INF\Message\MessageBuilder, \PEIP\INF\Handler\Handler, \PEIP\INF\Channel\Channel, \PEIP\INF\Channel\SubscribableChannel, \PEIP\INF\Event\Connectable, \PEIP\INF\Event\Listener
21
 */
22
23
24
25
class Wiretap extends \PEIP\Pipe\FixedEventPipe
26
{
27
    /**
28
     * @param $inputChannel
29
     * @param $outputChannel
30
     *
31
     * @return
32
     */
33 View Code Duplication
    public function __construct(\PEIP\INF\Channel\Channel $inputChannel, \PEIP\INF\Channel\Channel $outputChannel = null)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
34
    {
35
        $this->setEventName('preSend');
36
        $this->setInputChannel($inputChannel);
37
        if (is_object($outputChannel)) {
38
            $this->setOutputChannel($outputChannel);
39
        }
40
    }
41
42
    /**
43
     * @param $message
44
     *
45
     * @return
46
     */
47
    protected function doReply(\PEIP\INF\Message\Message $message)
48
    {
49
        $this->replyMessage($message->getHeader('MESSAGE'));
50
    }
51
}
52