Conditions | 4 |
Paths | 12 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
43 | public function clear($cacheDir): void |
||
44 | { |
||
45 | try { |
||
46 | $reflect = new \ReflectionClass($this->cacheProvider->getCacheAdapter()); |
||
47 | $adapter = $reflect->getShortName(); |
||
48 | } catch (\ReflectionException $e) { |
||
49 | $adapter = 'unknown'; |
||
50 | } |
||
51 | |||
52 | try { |
||
53 | if (!$this->cacheProvider->clear()) { |
||
54 | $this->logger->emergency('Failed to clear Mautic cache.', ['adapter' => $adapter]); |
||
55 | throw new \Exception('Failed to clear '.$adapter); |
||
56 | } |
||
57 | } catch (\PDOException $e) { |
||
58 | } |
||
61 |
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.