| Conditions | 4 |
| Paths | 4 |
| Total Lines | 24 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | public static function checkCollision(string $driverName): bool |
||
| 24 | { |
||
| 25 | $constantName = __NAMESPACE__ . '\MEMCACHE_DRIVER_USED'; |
||
| 26 | |||
| 27 | if ($driverName) { |
||
| 28 | if (!defined($constantName)) { |
||
| 29 | define($constantName, $driverName); |
||
| 30 | |||
| 31 | return true; |
||
| 32 | } |
||
| 33 | |||
| 34 | if (constant($constantName) !== $driverName) { |
||
| 35 | trigger_error( |
||
| 36 | 'Memcache collision detected, you used both Memcache and Memcached driver in your script, this may leads to unexpected behaviours', |
||
| 37 | E_USER_WARNING |
||
| 38 | ); |
||
| 39 | |||
| 40 | return false; |
||
| 41 | } |
||
| 42 | |||
| 43 | return true; |
||
| 44 | } |
||
| 45 | |||
| 46 | return false; |
||
| 47 | } |
||
| 49 |