DataSourceBuilderFactory::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
namespace Netdudes\DataSourceryBundle\DataSource;
3
4
use Netdudes\DataSourceryBundle\DataSource\Util\ChoicesBuilder;
5
use Symfony\Component\EventDispatcher\EventDispatcher;
6
7
class DataSourceBuilderFactory
8
{
9
    /**
10
     * @var ChoicesBuilder
11
     */
12
    private $choicesBuilder;
13
14
    public function __construct(ChoicesBuilder $choicesBuilder)
15
    {
16
        $this->choicesBuilder = $choicesBuilder;
17
    }
18
19
    public function create($entityClass, DataSourceFactoryInterface $dataSourceFactory)
20
    {
21
        $eventDispatcher = new EventDispatcher();
22
        return new DataSourceBuilder($entityClass, $eventDispatcher, $dataSourceFactory, $this->choicesBuilder);
23
    }
24
}
25