1 | <?php |
||
12 | class DataSource implements DataSourceInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var DoctrineDriver |
||
16 | */ |
||
17 | protected $driver; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $entityClass; |
||
23 | |||
24 | /** |
||
25 | * @var Field[] |
||
26 | */ |
||
27 | private $fields; |
||
28 | |||
29 | /** |
||
30 | * @var TransformerInterface[] |
||
31 | */ |
||
32 | private $transformers; |
||
33 | |||
34 | /** |
||
35 | * @var EventDispatcherInterface |
||
36 | */ |
||
37 | private $eventDispatcher; |
||
38 | |||
39 | /** |
||
40 | * @param $entityClass |
||
41 | * @param $fields |
||
42 | * @param $transformers |
||
43 | * @param EventDispatcherInterface $eventDispatcher |
||
44 | * @param DoctrineDriver $doctrineDriver |
||
45 | */ |
||
46 | public function __construct($entityClass, $fields, $transformers, EventDispatcherInterface $eventDispatcher, DriverInterface $doctrineDriver) |
||
54 | |||
55 | /** |
||
56 | * Return the data after being processed according to the $query |
||
57 | * |
||
58 | * @param QueryInterface $query |
||
59 | * |
||
60 | * @return array |
||
61 | */ |
||
62 | public function getData(QueryInterface $query) |
||
70 | |||
71 | /** |
||
72 | * Return the count of records returned by only filtering the data source, |
||
73 | * before any pagination is done. |
||
74 | * |
||
75 | * @param QueryInterface $query |
||
76 | * |
||
77 | * @return integer |
||
78 | */ |
||
79 | public function getRecordCount(QueryInterface $query) |
||
83 | |||
84 | /** |
||
85 | * Return list of data source fields available for the data source |
||
86 | * |
||
87 | * @return FieldInterface |
||
88 | */ |
||
89 | public function getFields() |
||
93 | |||
94 | public function getEntityClass() |
||
98 | |||
99 | public function getTransformers() |
||
103 | |||
104 | /** |
||
105 | * @return EventDispatcherInterface |
||
106 | */ |
||
107 | public function getEventDispatcher() |
||
111 | |||
112 | /** |
||
113 | * @param $rows |
||
114 | * |
||
115 | * @return mixed |
||
116 | */ |
||
117 | protected function applyTransformers($rows) |
||
127 | |||
128 | /** |
||
129 | * Build the select including the ones passed in the query plus the ones required by the |
||
130 | * transformers. |
||
131 | * |
||
132 | * @param QueryInterface $query |
||
133 | * |
||
134 | * @return mixed |
||
135 | */ |
||
136 | protected function calculateSelectFields(QueryInterface $query) |
||
146 | } |
||
147 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.