Skip to content

Commit 5e1ace8

Browse files
committed
improve phpdoc
1 parent 922d44b commit 5e1ace8

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/ClassDiscovery.php

+6-9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Http\Discovery\Exception\DiscoveryFailedException;
77
use Http\Discovery\Exception\NoCandidateFoundException;
88
use 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

Comments
 (0)