Completed
Push — master ( 674d5a...194be7 )
by Gorka
04:12
created

DoctrineORMOrganizationSpecificationFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A buildFilterableSpecification() 0 4 1
A buildBySlugSpecification() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Kreta 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
declare(strict_types=1);
14
15
namespace Kreta\TaskManager\Infrastructure\Persistence\Doctrine\ORM\Organization;
16
17
use Kreta\SharedKernel\Domain\Model\Identity\Slug;
18
use Kreta\TaskManager\Domain\Model\Organization\OrganizationSpecificationFactory;
19
use Kreta\TaskManager\Domain\Model\User\UserId;
20
21
class DoctrineORMOrganizationSpecificationFactory implements OrganizationSpecificationFactory
22
{
23
    public function buildFilterableSpecification($name, UserId $userId, int $offset = 0, int $limit = -1)
24
    {
25
        return new DoctrineORMFilterableSpecification($name, $userId, $offset, $limit);
26
    }
27
28
    public function buildBySlugSpecification(Slug $slug)
29
    {
30
        return new DoctrineORMBySlugSpecification($slug);
31
    }
32
}
33