MultiCallTransportEvent   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 56
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
c 0
b 0
f 0
lcom 0
cbo 1
dl 56
loc 56
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 6 6 1
A setQueue() 4 4 1
A getQueue() 4 4 1
A setResults() 4 4 1
A getResults() 4 4 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
/**
4
 * @project Magento Bridge for Symfony 2.
5
 *
6
 * @author  Sébastien MALOT <[email protected]>
7
 * @license MIT
8
 * @url     <https://github.com/smalot/magento-bundle>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Smalot\MagentoBundle\Event;
15
16
use Smalot\Magento\MultiCallQueueInterface;
17
use Smalot\Magento\RemoteAdapterInterface;
18
19
/**
20
 * Class MultiCallTransportEvent
21
 *
22
 * @package Smalot\MagentoBundle\Event
23
 */
24 View Code Duplication
class MultiCallTransportEvent extends AbstractEvent
0 ignored issues
show
Duplication introduced by
This class 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...
25
{
26
    /**
27
     * @var MultiCallQueueInterface
28
     */
29
    protected $queue;
30
31
    /**
32
     * @var mixed
33
     */
34
    protected $results;
35
36
    /**
37
     * @param RemoteAdapterInterface  $remoteAdapter
38
     * @param MultiCallQueueInterface $queue
39
     * @param mixed                   $results
40
     */
41
    public function __construct(RemoteAdapterInterface $remoteAdapter, MultiCallQueueInterface $queue, $results = null)
42
    {
43
        $this->remoteAdapter = $remoteAdapter;
44
        $this->queue         = $queue;
45
        $this->results       = $results;
46
    }
47
48
    /**
49
     * @param MultiCallQueueInterface $queue
50
     */
51
    public function setQueue(MultiCallQueueInterface $queue)
52
    {
53
        $this->queue = $queue;
54
    }
55
56
    /**
57
     * @return MultiCallQueueInterface
58
     */
59
    public function getQueue()
60
    {
61
        return $this->queue;
62
    }
63
64
    /**
65
     * @param array $results
66
     */
67
    public function setResults($results)
68
    {
69
        $this->results = $results;
70
    }
71
72
    /**
73
     * @return mixed
74
     */
75
    public function getResults()
76
    {
77
        return $this->results;
78
    }
79
}
80