AuraSqlPagerFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 22
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A newInstance() 0 6 1
1
<?php
2
/**
3
 * This file is part of the Ray.AuraSqlModule package.
4
 *
5
 * @license http://opensource.org/licenses/MIT MIT
6
 */
7
namespace Ray\AuraSqlModule\Pagerfanta;
8
9
use Aura\Sql\ExtendedPdoInterface;
10
11
class AuraSqlPagerFactory implements AuraSqlPagerFactoryInterface
12
{
13
    /**
14
     * @var AuraSqlPagerInterface
15
     */
16
    private $auraSqlPager;
17
18 4
    public function __construct(AuraSqlPagerInterface $auraSqlPager)
19
    {
20 4
        $this->auraSqlPager = $auraSqlPager;
21 4
    }
22
23
    /**
24
     * {@inheritdoc}
25
     */
26 3
    public function newInstance(ExtendedPdoInterface $pdo, string $sql, array $params, int $paging, string $uriTemplate) : AuraSqlPagerInterface
27
    {
28 3
        $this->auraSqlPager->init($pdo, $sql, $params, $paging, new DefaultRouteGenerator($uriTemplate));
29
30 3
        return $this->auraSqlPager;
31
    }
32
}
33