DoctrineDataProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 1
c 2
b 0
f 1
lcom 0
cbo 4
dl 0
loc 18
ccs 7
cts 7
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 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