Completed
Pull Request — master (#143)
by
unknown
02:35
created

ContactUsFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 50 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 8
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 8 8 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 Web\Factory\Action;
4
5
use ContactUs\Service\ContactUsService;
6
use Interop\Container\ContainerInterface;
7
use Web\Action\ContactUsAction;
8
use Zend\Expressive\Router\RouterInterface;
9
use Zend\Expressive\Template\TemplateRendererInterface;
10
11
/**
12
 * Class ContactUsAction
13
 *
14
 * @package Web\Action
15
 * @author  Djordje Stojiljkovic <[email protected]>
16
 */
17
class ContactUsFactory
18
{
19
    /**
20
     * @param ContainerInterface $container
21
     *
22
     * @return ContactUsAction
23
     */
24 View Code Duplication
    public function __invoke(ContainerInterface $container): ContactUsAction
0 ignored issues
show
Duplication introduced by
This method 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...
25
    {
26
        return new ContactUsAction(
27
            $container->get(TemplateRendererInterface::class),
28
            $container->get(ContactUsService::class),
29
            $container->get(RouterInterface::class)
30
        );
31
    }
32
}