1 | <?php |
||
8 | class DataSourceFactory implements DataSourceFactoryInterface |
||
9 | { |
||
10 | /** |
||
11 | * @var DataSourceBuilderFactory |
||
12 | */ |
||
13 | private $dataSourceBuilderFactory; |
||
14 | |||
15 | /** |
||
16 | * @param DriverInterface $driver |
||
17 | * @param DataSourceBuilderFactory $dataSourceBuilderFactory |
||
18 | */ |
||
19 | public function __construct(DriverInterface $driver, DataSourceBuilderFactory $dataSourceBuilderFactory) |
||
24 | |||
25 | /** |
||
26 | * @param DataSourceConfigurationInterface $configuration |
||
27 | * |
||
28 | * @return DataSourceInterface |
||
29 | */ |
||
30 | public function createFromConfiguration(DataSourceConfigurationInterface $configuration) |
||
37 | |||
38 | /** |
||
39 | * @param $entityClass |
||
40 | * @param $fields |
||
41 | * @param $transformers |
||
42 | * @param EventDispatcherInterface $eventDispatcher |
||
43 | * |
||
44 | * @return DataSource |
||
45 | */ |
||
46 | public function create($entityClass, array $fields, array $transformers, EventDispatcherInterface $eventDispatcher) |
||
50 | |||
51 | /** |
||
52 | * @param $entityClass |
||
53 | * |
||
54 | * @return DataSourceBuilder |
||
55 | */ |
||
56 | public function createBuilder($entityClass) |
||
60 | } |
||
61 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: