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 4
4
5
5
use Http \Discovery \Exception \DiscoveryFailedException ;
6
6
use Http \Discovery \Exception \StrategyUnavailableException ;
7
+ use Http \Discovery \Strategy \DiscoveryStrategy ;
7
8
8
9
/**
9
10
* Registry that based find results on class existence.
@@ -108,14 +109,36 @@ private static function storeInCache($type, $class)
108
109
/**
109
110
* Set new strategies and clear the cache.
110
111
*
111
- * @param array $strategies
112
+ * @param DiscoveryStrategy[] $strategies
112
113
*/
113
114
public static function setStrategies (array $ strategies )
114
115
{
115
116
self ::$ strategies = $ strategies ;
116
117
self ::clearCache ();
117
118
}
118
119
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
+
119
142
/**
120
143
* Clear the cache.
121
144
*/
You can’t perform that action at this time.
0 commit comments