| 1 | <?php |
||
| 12 | class DataProvider implements DataProviderInterface |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var RepositoryInterface |
||
| 16 | */ |
||
| 17 | protected $repository; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * DataProvider constructor. |
||
| 21 | * |
||
| 22 | * @param ObjectRepository $repository |
||
| 23 | */ |
||
| 24 | public function __construct( |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Find entities by criteria. |
||
| 32 | * |
||
| 33 | * @param array $criteria |
||
| 34 | * @param array $orderBy |
||
| 35 | * @param int|null $limit |
||
| 36 | * @param int|null $offset |
||
| 37 | * @return Collection |
||
| 38 | */ |
||
| 39 | public function findBy(array $criteria = [], $orderBy = [], $limit = null, $offset = null) |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Find an entity by its unique id. |
||
| 48 | * |
||
| 49 | * @param $id |
||
| 50 | * @return object |
||
| 51 | */ |
||
| 52 | public function find($id) |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Save an entity. |
||
| 61 | * |
||
| 62 | * @param $entity |
||
| 63 | */ |
||
| 64 | public function save($entity) |
||
| 70 | |||
| 71 | /** |
||
| 72 | * Remove an entity. |
||
| 73 | * |
||
| 74 | * @param $entity |
||
| 75 | */ |
||
| 76 | public function remove($entity) |
||
| 82 | |||
| 83 | /** |
||
| 84 | * Create a new entity. |
||
| 85 | * |
||
| 86 | * @return object |
||
| 87 | */ |
||
| 88 | public function create() |
||
| 94 | } |
||
| 95 |
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.