Completed
Pull Request — master (#1)
by Daniel
12:19
created

CmobiAMQPChannel::exchangeDeclare()   B

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
     * @return mixed|null
12
     */
13 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...
14
    {
15
        list (
16
            $queue,
17
            $passive,
18
            $durable,
19
            $exclusive,
20
            $auto_delete,
21
            $nowait,
22
            $arguments,
23
            $ticket
24
            ) = $params;
25
26
        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...
27
            $queue,
28
            $passive,
29
            $durable,
30
            $exclusive,
31
            $auto_delete,
32
            $nowait,
33
            $arguments,
34
            $ticket
35
        );
36
    }
37
38
    /**
39
     * @param array $params
40
     * @param $callback
41
     * @return mixed|string
42
     */
43 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...
44
    {
45
        list (
46
            $queue,
47
            $consumer_tag,
48
            $no_local,
49
            $no_ack,
50
            $exclusive,
51
            $nowait,
52
            $ticket,
53
            $arguments
54
            ) = $params;
55
56
        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...
57
            $queue,
58
            $consumer_tag,
59
            $no_local,
60
            $no_ack,
61
            $exclusive,
62
            $nowait,
63
            $callback,
64
            $ticket,
65
            $arguments
66
        );
67
    }
68
69
    /**
70
     * @param array $params
71
     * @return mixed|null
72
     */
73 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...
74
    {
75
        list (
76
        $exchange,
77
        $type,
78
        $passive,
79
        $durable,
80
        $autoDelete,
81
        $internal,
82
        $nowait,
83
        $arguments,
84
        $ticket
85
        ) = $params;
86
87
        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...
88
            $exchange,
89
            $type,
90
            $passive,
91
            $durable,
92
            $autoDelete,
93
            $internal,
94
            $nowait,
95
            $arguments,
96
            $ticket
97
        );
98
    }
99
}