DoctrineDataProvider::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 9
ccs 7
cts 7
cp 1
rs 9.6666
cc 1
eloc 6
nc 1
nop 2
crap 1
1
<?php
2
3
namespace ViewComponents\Doctrine;
4
5
use Doctrine\DBAL\Query\QueryBuilder;
6
use ViewComponents\ViewComponents\Data\AbstractDataProvider;
7
use ViewComponents\ViewComponents\Data\Operation\OperationInterface;
8
9
/**
10
 * Data provider that uses Doctrine DBAL query builder as data source.
11
 */
12
class DoctrineDataProvider extends AbstractDataProvider
13
{
14
    /**
15
     * Constructor.
16
     *
17
     * @param QueryBuilder $src
18
     * @param OperationInterface[] $operations
19
     */
20 12
    public function __construct(QueryBuilder $src, array $operations = [])
21
    {
22 12
        $this->operations()->set($operations);
23 12
        $this->processingService = new DoctrineProcessingService(
24 12
            new DoctrineProcessorResolver(),
25 12
            $this->operations(),
26
            $src
27 12
        );
28 12
    }
29
}
30