@@ -61,9 +61,6 @@ public function __invoke(ContainerInterface $container, string $serviceName, cal
6161 * Inspects the configuration provided to determine if a middleware pipeline
6262 * exists to inject in the application.
6363 *
64- * If no pipeline is defined, but routes *are*, then the method will inject
65- * the routing and dispatch middleware.
66- *
6764 * Use the following configuration format:
6865 *
6966 * <code>
@@ -129,7 +126,38 @@ public static function injectPipelineFromConfig(Application $application, array
129126 /**
130127 * Inject routes from configuration.
131128 *
132- * Proxies to ApplicationConfigInjectionDelegator::injectRoutesFromConfig
129+ * Introspects the provided configuration for routes to inject in the
130+ * application instance.
131+ *
132+ * The following configuration structure can be used to define routes:
133+ *
134+ * <code>
135+ * return [
136+ * 'routes' => [
137+ * [
138+ * 'path' => '/path/to/match',
139+ * 'middleware' => 'Middleware Service Name or Callable',
140+ * 'allowed_methods' => ['GET', 'POST', 'PATCH'],
141+ * 'options' => [
142+ * 'stuff' => 'to',
143+ * 'pass' => 'to',
144+ * 'the' => 'underlying router',
145+ * ],
146+ * ],
147+ * // etc.
148+ * ],
149+ * ];
150+ * </code>
151+ *
152+ * Each route MUST have a path and middleware key at the minimum.
153+ *
154+ * The "allowed_methods" key may be omitted, can be either an array or the
155+ * value of the Zend\Expressive\Router\Route::HTTP_METHOD_ANY constant; any
156+ * valid HTTP method token is allowed, which means you can specify custom HTTP
157+ * methods as well.
158+ *
159+ * The "options" key may also be omitted, and its interpretation will be
160+ * dependent on the underlying router used.
133161 *
134162 * @throws InvalidArgumentException
135163 */
@@ -144,7 +172,7 @@ public static function injectRoutesFromConfig(Application $application, array $c
144172 continue ;
145173 }
146174
147- $ methods = null ;
175+ $ methods = Route:: HTTP_METHOD_ANY ;
148176 if (isset ($ spec ['allowed_methods ' ])) {
149177 $ methods = $ spec ['allowed_methods ' ];
150178 if (! is_array ($ methods )) {
0 commit comments