CmobiAMQPChannel::exchangeDeclare()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 26
Code Lines 22

Duplication

Lines 26
Ratio 100 %

Importance

Changes 0
Metric Value
dl 26
loc 26
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 22
nc 1
nop 1
1
<?php
2
3
namespace Cmobi\RabbitmqBundle\Connection;
4
5
use PhpAmqpLib\Channel\AMQPChannel;
6
7
class CmobiAMQPChannel extends AMQPChannel
8
{
9
    /**
10
     * @param array $params
11
     *
12
     * @return mixed|null
13
     */
14 View Code Duplication
    public function queueDeclare(array $params)
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...
15
    {
16
        list(
17
            $queue,
18
            $passive,
19
            $durable,
20
            $exclusive,
21
            $auto_delete,
22
            $nowait,
23
            $arguments,
24
            $ticket
25
            ) = $params;
26
27
        return parent::queue_declare(
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (queue_declare() instead of queueDeclare()). Are you sure this is correct? If so, you might want to change this to $this->queue_declare().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
28
            $queue,
29
            $passive,
30
            $durable,
31
            $exclusive,
32
            $auto_delete,
33
            $nowait,
34
            $arguments,
35
            $ticket
36
        );
37
    }
38
39
    /**
40
     * @param array $params
41
     * @param $callback
42
     *
43
     * @return mixed|string
44
     */
45 View Code Duplication
    public function basicConsume(array $params, $callback)
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...
46
    {
47
        list(
48
            $queue,
49
            $consumer_tag,
50
            $no_local,
51
            $no_ack,
52
            $exclusive,
53
            $nowait,
54
            $ticket,
55
            $arguments
56
            ) = $params;
57
58
        return parent::basic_consume(
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (basic_consume() instead of basicConsume()). Are you sure this is correct? If so, you might want to change this to $this->basic_consume().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
59
            $queue,
60
            $consumer_tag,
61
            $no_local,
62
            $no_ack,
63
            $exclusive,
64
            $nowait,
65
            $callback,
66
            $ticket,
67
            $arguments
68
        );
69
    }
70
71
    /**
72
     * @param array $params
73
     *
74
     * @return mixed|null
75
     */
76 View Code Duplication
    public function exchangeDeclare(array $params)
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...
77
    {
78
        list(
79
        $exchange,
80
        $type,
81
        $passive,
82
        $durable,
83
        $autoDelete,
84
        $internal,
85
        $nowait,
86
        $arguments,
87
        $ticket
88
        ) = $params;
89
90
        return parent::exchange_declare(
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (exchange_declare() instead of exchangeDeclare()). Are you sure this is correct? If so, you might want to change this to $this->exchange_declare().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
91
            $exchange,
92
            $type,
93
            $passive,
94
            $durable,
95
            $autoDelete,
96
            $internal,
97
            $nowait,
98
            $arguments,
99
            $ticket
100
        );
101
    }
102
}
103