Conditions | 6 |
Paths | 6 |
Total Lines | 29 |
Code Lines | 20 |
Lines | 29 |
Ratio | 100 % |
Tests | 18 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
24 | 11 | public function __invoke(Method $method, Str $arguments): StreamInterface |
|
25 | { |
||
26 | switch (true) { |
||
27 | 11 | case Methods::get('queue.declare-ok')->equals($method): |
|
1 ignored issue
–
show
|
|||
28 | 2 | $visit = $this->declareOk(); |
|
29 | 2 | break; |
|
30 | |||
31 | 9 | case Methods::get('queue.bind-ok')->equals($method): |
|
1 ignored issue
–
show
|
|||
32 | 2 | $visit = $this->bindOk(); |
|
33 | 2 | break; |
|
34 | |||
35 | 7 | case Methods::get('queue.unbind-ok')->equals($method): |
|
1 ignored issue
–
show
|
|||
36 | 2 | $visit = $this->unbindOk(); |
|
37 | 2 | break; |
|
38 | |||
39 | 5 | case Methods::get('queue.purge-ok')->equals($method): |
|
1 ignored issue
–
show
|
|||
40 | 2 | $visit = $this->purgeOk(); |
|
41 | 2 | break; |
|
42 | |||
43 | 3 | case Methods::get('queue.delete-ok')->equals($method): |
|
1 ignored issue
–
show
|
|||
44 | 2 | $visit = $this->deleteOk(); |
|
45 | 2 | break; |
|
46 | |||
47 | default: |
||
48 | 1 | throw new UnknownMethod($method); |
|
49 | } |
||
50 | |||
51 | 10 | return $visit($arguments); |
|
52 | } |
||
53 | |||
87 |
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.