Completed
Push — master ( ebc8e7...c63252 )
by Beñat
05:58
created

DoctrineORMFileSpecificationFactory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A buildFilterByNameSpecification() 0 4 1
A buildListOfIdsSpecification() 0 4 1
A buildByNameSpecification() 0 4 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\DoctrineORMBridge\Infrastructure\Persistence;
14
15
use BenGorFile\File\Domain\Model\FileName;
16
use BenGorFile\File\Domain\Model\FileSpecificationFactory;
17
18
/**
19
 * @author Beñat Espiña <[email protected]>
20
 */
21
class DoctrineORMFileSpecificationFactory implements FileSpecificationFactory
22
{
23
    public function buildFilterByNameSpecification($fileName, $offset = 0, $limit = -1)
24
    {
25
        return new DoctrineORMFilterByNameSpecification($fileName, $offset, $limit);
26
    }
27
28
    public function buildListOfIdsSpecification(array $ids, $offset = 0, $limit = -1)
29
    {
30
        return new DoctrineORMListOfIdsSpecification($ids);
31
    }
32
33
    public function buildByNameSpecification(FileName $fileName)
34
    {
35
        return new DoctrineORMByNameSpecification($fileName);
36
    }
37
}
38