AuraSqlQueryPagerFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 5
c 1
b 0
f 1
dl 0
loc 17
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A newInstance() 0 5 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ray\AuraSqlModule\Pagerfanta;
6
7
use Aura\Sql\ExtendedPdoInterface;
8
use Aura\SqlQuery\Common\SelectInterface;
9
10
class AuraSqlQueryPagerFactory implements AuraSqlQueryPagerFactoryInterface
11
{
12
    private AuraSqlQueryPagerInterface $auraSqlQueryPager;
13
14
    public function __construct(AuraSqlQueryPagerInterface $auraSqlQueryPager)
15
    {
16
        $this->auraSqlQueryPager = $auraSqlQueryPager;
17
    }
18
19
    /**
20
     * {@inheritDoc}
21
     */
22
    public function newInstance(ExtendedPdoInterface $pdo, SelectInterface $select, $paging, $uriTemplate)
23
    {
24
        $this->auraSqlQueryPager->init($pdo, $select, $paging, new DefaultRouteGenerator($uriTemplate));
25
26
        return $this->auraSqlQueryPager;
27
    }
28
}
29