Psalm - how to deal with optional classes

126 Views Asked by At

I have a cache factory that will use one of many cache drivers: File, Redis, Memcache, etc.
Because it's either-or, my code can be used both with and without certain PHP extensions.
eg. If you use Redis, you don't need ext-memcached installed.
But If I run psalm I get error saying: UndefinedClass - foo/bar/CacheFactory.php:99:25 - Class, interface or enum named Memcached does not exist

Is there a way to tell psalm to ignore classes from not installed extensions?

0

There are 0 best solutions below