@@ -107,12 +107,16 @@ public function __construct($config, RequestInterface $request, ResponseInterfac
107107 $ this ->setResponse ($ response );
108108
109109 $ this ->modules = $ modules ?? config ('Modules ' );
110+
111+ if ($ this ->modules ->shouldDiscover ('filters ' )) {
112+ $ this ->discoverFilters ();
113+ }
110114 }
111115
112116 /**
113117 * If discoverFilters is enabled in Config then system will try to
114118 * auto-discover custom filters files in Namespaces and allow access to
115- * the config object via the variable $customfilters as with the routes file
119+ * the config object via the variable $filters as with the routes file
116120 *
117121 * Sample :
118122 * $filters->aliases['custom-auth'] = \Acme\Blob\Filters\BlobAuth::class;
@@ -211,12 +215,10 @@ public function run(string $uri, string $position = 'before')
211215 * The resulting $this->filters is an array of only filters
212216 * that should be applied to this request.
213217 *
214- * We go ahead an process the entire tree because we'll need to
218+ * We go ahead and process the entire tree because we'll need to
215219 * run through both a before and after and don't want to double
216220 * process the rows.
217221 *
218- * @param string $uri
219- *
220222 * @return Filters
221223 */
222224 public function initialize (?string $ uri = null )
@@ -225,10 +227,6 @@ public function initialize(?string $uri = null)
225227 return $ this ;
226228 }
227229
228- if ($ this ->modules ->shouldDiscover ('filters ' )) {
229- $ this ->discoverFilters ();
230- }
231-
232230 $ this ->processGlobals ($ uri );
233231 $ this ->processMethods ();
234232 $ this ->processFilters ($ uri );
0 commit comments