- Issue created by @drunken monkey
Currently, we have a lot of code that does something like the following:
if ($index->hasValidTracker()) {
return $index->getTrackerInstance()->…();
}
While this will never throw an exception (or only in extreme edge cases), IDEs still complain about an unchecked exception because getTrackerInstance()
is documented to throw an exception if the plugin could not be loaded. As a consequence, it is sometimes impossible to write clean code using the Search API without including unnecessary try
/catch
constructs.
Add variants like getTrackerInstanceIfAvailable()
that return NULL
instead of throwing an exception and use that where appropriate.
Active
1.0
Framework