Completed
Pull Request — master (#2)
by Саша
08:50
created

CallbackTransformerSpec   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 22
loc 22
rs 10
c 1
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 4 4 1
A it_is_initializable() 4 4 1
A it_implements_transformer_interface() 4 4 1
A it_transforms_data_using_callback() 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
namespace spec\Extraload\Transformer;
4
5
use PhpSpec\ObjectBehavior;
6
use Prophecy\Argument;
7
8 View Code Duplication
class CallbackTransformerSpec extends ObjectBehavior
1 ignored issue
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...
9
{
10
    function let()
11
    {
12
        $this->beConstructedWith('array_reverse');
13
    }
14
15
    function it_is_initializable()
16
    {
17
        $this->shouldHaveType('Extraload\Transformer\CallbackTransformer');
18
    }
19
20
    function it_implements_transformer_interface()
21
    {
22
        $this->shouldImplement('Extraload\Transformer\TransformerInterface');
23
    }
24
25
    function it_transforms_data_using_callback()
26
    {
27
        $this->transform(['foo', 'bar'])->shouldReturn(['bar', 'foo']);
28
    }
29
}
30