66use Http \Discovery \Exception \DiscoveryFailedException ;
77use Http \Discovery \Exception \NoCandidateFoundException ;
88use Http \Discovery \Exception \StrategyUnavailableException ;
9+ use Http \Discovery \Strategy \DiscoveryStrategy ;
910
1011/**
1112 * Registry that based find results on class existence.
@@ -19,7 +20,7 @@ abstract class ClassDiscovery
1920 /**
2021 * A list of strategies to find classes.
2122 *
22- * @var array
23+ * @var DiscoveryStrategy[]
2324 */
2425 private static $ strategies = [
2526 Strategy \GeneratedDiscoveryStrategy::class,
@@ -130,7 +131,7 @@ private static function storeInCache($type, $class)
130131 /**
131132 * Set new strategies and clear the cache.
132133 *
133- * @param array $strategies string array of fully qualified class name to a DiscoveryStrategy
134+ * @param string[] $strategies list of fully qualified class names that implement DiscoveryStrategy
134135 */
135136 public static function setStrategies (array $ strategies )
136137 {
@@ -151,7 +152,7 @@ public static function getStrategies(): iterable
151152 /**
152153 * Append a strategy at the end of the strategy queue.
153154 *
154- * @param string $strategy Fully qualified class name to a DiscoveryStrategy
155+ * @param string $strategy Fully qualified class name of a DiscoveryStrategy
155156 */
156157 public static function appendStrategy ($ strategy )
157158 {
@@ -170,9 +171,6 @@ public static function prependStrategy($strategy)
170171 self ::clearCache ();
171172 }
172173
173- /**
174- * Clear the cache.
175- */
176174 public static function clearCache ()
177175 {
178176 self ::$ cache = [];
@@ -238,14 +236,13 @@ protected static function instantiateClass($class)
238236 }
239237
240238 /**
241- * We want to do a "safe" version of PHP's "class_exists" because Magento has a bug
239+ * We need a "safe" version of PHP's "class_exists" because Magento has a bug
242240 * (or they call it a "feature"). Magento is throwing an exception if you do class_exists()
243241 * on a class that ends with "Factory" and if that file does not exits.
244242 *
245- * This function will catch all potential exceptions and make sure it returns a boolean.
243+ * This function catches all potential exceptions and makes sure to always return a boolean.
246244 *
247245 * @param string $class
248- * @param bool $autoload
249246 *
250247 * @return bool
251248 */
0 commit comments