Completed
Pull Request — master (#8)
by Саша
21:35
created

NoopTransformerSpec   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
lcom 0
cbo 1
dl 17
loc 17
rs 10
c 1
b 0
f 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
class NoopTransformerSpec extends ObjectBehavior
9
{
10
    function it_is_initializable()
11
    {
12
        $this->shouldHaveType('Extraload\Transformer\NoopTransformer');
13
    }
14
15
    function it_implements_transformer_interface()
16
    {
17
        $this->shouldImplement('Extraload\Transformer\TransformerInterface');
18
    }
19
20
    function it_returns_original_data()
21
    {
22
        $this->transform(['foo', 'bar'])->shouldReturn(['foo', 'bar']);
23
    }
24
}
25