Completed
Push — master ( 2a0b01...28b040 )
by Tomasz
02:38
created

UseCaseIdSpec   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 4 4 1
A it_is_initializable() 5 5 1
A it_should_return_domain_id_by_getter() 4 4 1
A it_should_return_id_by_getter() 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\Hexarchium\CoreDomain\Model\Domain\UseCase;
4
5
use Hexarchium\CoreDomain\Model\Domain\DomainId;
6
use Hexarchium\CoreDomain\Model\Domain\UseCase\UseCaseId;
7
use Hexarchium\CoreDomain\ValueObject\AbstractDomainId;
8
use PhpSpec\ObjectBehavior;
9
10 View Code Duplication
class UseCaseIdSpec extends ObjectBehavior
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...
11
{
12
    function let()
13
    {
14
        $this->beConstructedWith(new DomainId('DomainId'), 'UseCaseId');
15
    }
16
17
    function it_is_initializable()
18
    {
19
        $this->shouldHaveType(UseCaseId::class);
20
        $this->shouldBeAnInstanceOf(AbstractDomainId::class);
21
    }
22
23
    function it_should_return_domain_id_by_getter()
24
    {
25
        $this->getDomainId()->shouldBeAnInstanceOf(DomainId::class);
26
    }
27
28
    function it_should_return_id_by_getter()
29
    {
30
        $this->getId()->shouldReturn('UseCaseId');
31
    }
32
}
33