TenantRepositorySpec   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 18
loc 18
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 4 4 1
A it_is_initializable() 4 4 1
A it_is_a_repository() 5 5 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
 * This file is part of the Superdesk Web Publisher MultiTenancy Bundle.
5
 *
6
 * Copyright 2016 Sourcefabric z.ú. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2016 Sourcefabric z.ú
12
 * @license http://www.superdesk.org/license
13
 */
14
15
namespace spec\SWP\Bundle\MultiTenancyBundle\Doctrine\PHPCR;
16
17
use Doctrine\ODM\PHPCR\DocumentManagerInterface;
18
use Doctrine\ODM\PHPCR\Mapping\ClassMetadata;
19
use PhpSpec\ObjectBehavior;
20
use SWP\Bundle\MultiTenancyBundle\Doctrine\PHPCR\TenantRepository;
21
use SWP\Bundle\StorageBundle\Doctrine\ODM\PHPCR\DocumentRepository;
22
use SWP\Component\MultiTenancy\Repository\TenantRepositoryInterface;
23
24
/**
25
 * @mixin TenantRepository
26
 */
27 View Code Duplication
class TenantRepositorySpec 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...
28
{
29
    public function let(DocumentManagerInterface $documentManager, ClassMetadata $classMetadata)
30
    {
31
        $this->beConstructedWith($documentManager, $classMetadata);
32
    }
33
34
    public function it_is_initializable()
35
    {
36
        $this->shouldHaveType(TenantRepository::class);
37
    }
38
39
    public function it_is_a_repository()
40
    {
41
        $this->shouldHaveType(DocumentRepository::class);
42
        $this->shouldImplement(TenantRepositoryInterface::class);
43
    }
44
}
45