1 | <?php |
||
20 | class DoctrineAdapter implements |
||
21 | SimpleDataMapperInterface, |
||
22 | DeferredOperationProvider, |
||
23 | DeferredSaveProvider, |
||
24 | DeferredRemoveProvider, |
||
25 | ObjectManagerAwareInterface |
||
26 | { |
||
27 | use ObjectManagerAwareTrait; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $entityClass; |
||
33 | |||
34 | /** |
||
35 | * @param ObjectManager $objectManager |
||
36 | * @param string $entityClass |
||
37 | */ |
||
38 | 6 | public function __construct($entityClass, ObjectManager $objectManager) |
|
43 | |||
44 | /** |
||
45 | * The entity class handled by this adapter. Must be set during instantiation and it's immutable. |
||
46 | * |
||
47 | * @return string |
||
48 | */ |
||
49 | 2 | public function getEntityClass() |
|
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | 4 | public function findByUuid($uuid) |
|
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | */ |
||
73 | 1 | public function remove($entity) |
|
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | */ |
||
82 | 1 | public function removeByUuid($uuid) |
|
87 | |||
88 | /** |
||
89 | * {@inheritdoc} |
||
90 | */ |
||
91 | 2 | public function save($entity) |
|
96 | |||
97 | /** |
||
98 | * {@inheritdoc} |
||
99 | */ |
||
100 | 1 | public function saveDeferred($entity) |
|
104 | |||
105 | /** |
||
106 | * {@inheritdoc} |
||
107 | */ |
||
108 | 1 | public function removeDeferred($entity) |
|
112 | |||
113 | /** |
||
114 | * {@inheritdoc} |
||
115 | */ |
||
116 | 2 | public function commit() |
|
120 | } |
||
121 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.