Completed
Push — master ( f641a7...bf0d30 )
by Beñat
02:09
created

AllFilesQueryBuilder::definitionName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the BenGorFile package.
5
 *
6
 * (c) Beñat Espiña <[email protected]>
7
 * (c) Gorka Laucirica <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace BenGorFile\FileBundle\DependencyInjection\Compiler\Application\Query;
14
15
use BenGorFile\File\Application\Query\AllFilesHandler;
16
use Symfony\Component\DependencyInjection\Definition;
17
18
/**
19
 * All files query builder.
20
 *
21
 * @author Beñat Espiña <[email protected]>
22
 */
23 View Code Duplication
class AllFilesQueryBuilder extends QueryBuilder
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...
24
{
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function register($file)
29
    {
30
        $this->container->setDefinition(
31
            $this->definitionName($file),
32
            new Definition(
33
                AllFilesHandler::class, [
34
                    $this->container->getDefinition(
35
                        'bengor.file.infrastructure.persistence.' . $file . '_repository'
36
                    ),
37
                    $this->container->getDefinition(
38
                        'bengor.file.application.data_transformer.' . $file . '_dto'
39
                    ),
40
                ]
41
            )
42
        );
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    protected function definitionName($file)
49
    {
50
        return 'bengor.file.application.query.all_' . $file . 's';
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56
    protected function aliasDefinitionName($file)
57
    {
58
        return 'bengor_file.' . $file . '.all_query';
59
    }
60
}
61