File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change 44
55use Http \Discovery \Exception \DiscoveryFailedException ;
66use Http \Discovery \Exception \StrategyUnavailableException ;
7+ use Http \Discovery \Strategy \DiscoveryStrategy ;
78
89/**
910 * Registry that based find results on class existence.
@@ -108,14 +109,36 @@ private static function storeInCache($type, $class)
108109 /**
109110 * Set new strategies and clear the cache.
110111 *
111- * @param array $strategies
112+ * @param DiscoveryStrategy[] $strategies
112113 */
113114 public static function setStrategies (array $ strategies )
114115 {
115116 self ::$ strategies = $ strategies ;
116117 self ::clearCache ();
117118 }
118119
120+ /**
121+ * Append a strategy at the end of the strategy queue.
122+ *
123+ * @param DiscoveryStrategy $strategy
124+ */
125+ public static function appendStrategy (DiscoveryStrategy $ strategy )
126+ {
127+ self ::$ strategies [] = $ strategy ;
128+ self ::clearCache ();
129+ }
130+
131+ /**
132+ * Prepend a strategy at the beginning of the strategy queue.
133+ *
134+ * @param DiscoveryStrategy $strategy
135+ */
136+ public static function prependStrategy (DiscoveryStrategy $ strategy )
137+ {
138+ self ::$ strategies = array_unshift (self ::$ strategies , $ strategy );
139+ self ::clearCache ();
140+ }
141+
119142 /**
120143 * Clear the cache.
121144 */
You can’t perform that action at this time.
0 commit comments