Code Duplication    Length = 38-38 lines in 2 locations

src/BenGorFile/FileBundle/DependencyInjection/Compiler/Application/Query/FileOfIdQueryBuilder.php 1 location

@@ 23-60 (lines=38) @@
20
 *
21
 * @author Beñat Espiña <[email protected]>
22
 */
23
class FileOfIdQueryBuilder extends QueryBuilder
24
{
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function register($file)
29
    {
30
        $this->container->setDefinition(
31
            $this->definitionName($file),
32
            new Definition(
33
                FileOfIdHandler::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.' . $file . '_of_id';
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56
    protected function aliasDefinitionName($file)
57
    {
58
        return 'bengor_file.' . $file . '.by_id_query';
59
    }
60
}
61

src/BenGorFile/FileBundle/DependencyInjection/Compiler/Application/Query/CountFilesQueryBuilder.php 1 location

@@ 23-60 (lines=38) @@
20
 *
21
 * @author Beñat Espiña <[email protected]>
22
 */
23
class CountFilesQueryBuilder extends QueryBuilder
24
{
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function register($file)
29
    {
30
        $this->container->setDefinition(
31
            $this->definitionName($file),
32
            new Definition(
33
                CountFilesHandler::class, [
34
                    $this->container->getDefinition(
35
                        'bengor.file.infrastructure.persistence.' . $file . '_repository'
36
                    ),
37
                    $this->container->getDefinition(
38
                        'bengor.file.infrastructure.persistence.' . $file . '_specification_factory'
39
                    ),
40
                ]
41
            )
42
        );
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    protected function definitionName($file)
49
    {
50
        return 'bengor.file.application.query.count_' . $file . 's';
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56
    protected function aliasDefinitionName($file)
57
    {
58
        return 'bengor_file.count_' . $file . 's_query';
59
    }
60
}
61