Completed
Push — master ( 1daec9...23ac06 )
by Johannes
03:41
created

SingleBlogEntryActionFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 76.92 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 10 10 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
 * Lichtenwallner  (https://lichtenwallner.at)
4
 *
5
 * @see https://github.com/jolicht/markdown-cms for the canonical source repository
6
 * @license https://github.com/jolicht/markdown-cms/blob/master/LICENSE MIT
7
 * @copyright Copyright (c) Johannes Lichtenwallner
8
 */
9
declare(strict_types = 1);
10
namespace Jolicht\MarkdownCms\Action;
11
12
use Zend\ServiceManager\Factory\FactoryInterface;
13
use Interop\Container\ContainerInterface;
14
use Jolicht\MarkdownCms\Markdown\MarkdownDocumentParser;
15
use Zend\Expressive\Template\TemplateRendererInterface;
16
use Jolicht\MarkdownCms\ContentType\ContentCreator;
17
18
class SingleBlogEntryActionFactory implements FactoryInterface
19
{
20 View Code Duplication
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null) : SingleBlogEntryAction
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...
21
    {
22
        $config = $container->get('config');
23
        return new SingleBlogEntryAction(
24
            $container->get(TemplateRendererInterface::class),
25
            $container->get(ContentCreator::class),
26
            $container->get(MarkdownDocumentParser::class),
27
            $config['markdown_cms']
28
        );
29
    }
30
}