Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions doc/book/cookbook/autowiring-routes-and-pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ With regards to routes, there are other considerations:
in use. As an example, each of the currently supported router implementations
has a different syntax for placeholders:

- `/user/:id` + "constraints" configuration to define constraints (zend-router)
- `/user/{id}` + "tokens" configuration to define constraints (Aura.Router)
- `/user/{id:\d+}` (FastRoute)
- `/user/:id` + "constraints" configuration to define constraints (zend-router)
- `/user/{id}` + "tokens" configuration to define constraints (Aura.Router)
- `/user/{id:\d+}` (FastRoute)

- Your application may have specific routing considerations or design.

Expand All @@ -204,7 +204,7 @@ delegator factory by wiring it into their own configuration.

- We recommend using delegator factories for the purpose of autowiring routes,
and, with caveats, pipeline middleware:
- The pipeline should be created exactly once, so calls to `pipe()` should
occur in exactly _one_ delegator factory.
- The pipeline should be created exactly once, so calls to `pipe()` should
occur in exactly _one_ delegator factory.
- Distributable packages should create a delegator factory for _routes only_,
but _should not_ register the delegator factory by default.
38 changes: 19 additions & 19 deletions doc/book/features/application.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ where:
`Zend\Expressive\Router\Route` instance.
- `$middleware` **must** be present if `$pathOrRoute` is a string path, and
**must** be:
- a callable;
- a service name that resolves to valid middleware in the container;
- a fully qualified class name of a constructor-less class;
- an array of any of the above; these will be composed in order into a
`Zend\Stratigility\MiddlewarePipe` instance.
- a callable;
- a service name that resolves to valid middleware in the container;
- a fully qualified class name of a constructor-less class;
- an array of any of the above; these will be composed in order into a
`Zend\Stratigility\MiddlewarePipe` instance.
- `$methods` must be an array of HTTP methods valid for the given path and
middleware. If null, it assumes any method is valid.
- `$name` is the optional name for the route, and is used when generating a URI
Expand Down Expand Up @@ -180,11 +180,11 @@ where:
composed container.
- `$middleware` is required if `$pathOrMiddleware` is a string URI path. It can
be one of:
- a callable;
- a service name that resolves to valid middleware in the container;
- a fully qualified class name of a constructor-less class;
- an array of any of the above; these will be composed in order into a
`Zend\Stratigility\MiddlewarePipe` instance.
- a callable;
- a service name that resolves to valid middleware in the container;
- a fully qualified class name of a constructor-less class;
- an array of any of the above; these will be composed in order into a
`Zend\Stratigility\MiddlewarePipe` instance.

Unlike `Zend\Stratigility\MiddlewarePipe`, `Application::pipe()` *allows
fetching middleware by service name*. This facility allows lazy-loading of
Expand Down Expand Up @@ -238,15 +238,15 @@ methods for retrieving them. They include:
[emitter](https://github.com/zendframework/zend-diactoros/blob/master/doc/book/emitting-responses.md),
typically a `Zend\Expressive\Emitter\EmitterStack` instance.
- `getDefaultDelegate()`: (Since 2.0) retrieves the default delegate to use when the internal middleware pipeline is exhausted without returning a response. If none is provided at instantiation, this method will do one of the following:
- If no container is composed, instanatiates a
`Zend\Expressive\Delegate\NotFoundDelegate` using the composed response
prototype only.
- If a container is composed, but does not have the
`Zend\Expressive\Delegate\DefaultDelegate` service, it creates and invokes an
instance of `Zend\Expressive\Container\NotFoundDelegateFactory`, passing it
the composed container, and uses the value created.
- If a container is composed and contains the `Zend\Expressive\Delegate\DefaultDelegate`
service, it returns that.
- If no container is composed, instanatiates a
`Zend\Expressive\Delegate\NotFoundDelegate` using the composed response
prototype only.
- If a container is composed, but does not have the
`Zend\Expressive\Delegate\DefaultDelegate` service, it creates and invokes an
instance of `Zend\Expressive\Container\NotFoundDelegateFactory`, passing it
the composed container, and uses the value created.
- If a container is composed and contains the `Zend\Expressive\Delegate\DefaultDelegate`
service, it returns that.
- `getFinalHandler(ResponseInterface $response = null)`: (**REMOVED in version 2.0**)
retrieves the final handler instance. This is middleware with the signature
`function ($request, $response, $error = null)`, and it is invoked when the
Expand Down
24 changes: 12 additions & 12 deletions doc/book/features/helpers/url-helper.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ Where:
request.
- `$rotueParams` is an array of substitutions to use for the provided route, with the
following behavior:
- If a `RouteResult` is composed in the helper, and the `$routeName` matches
it, the provided `$params` will be merged with any matched parameters, with
those provided taking precedence.
- If a `RouteResult` is not composed, or if the composed result does not match
the provided `$routeName`, then only the `$params` provided will be used
for substitutions.
- If no `$params` are provided, and the `$routeName` matches the currently
matched route, then any matched parameters found will be used.
parameters found will be used.
- If no `$params` are provided, and the `$routeName` does not match the
currently matched route, or if no route result is present, then no
substitutions will be made.
- If a `RouteResult` is composed in the helper, and the `$routeName` matches
it, the provided `$params` will be merged with any matched parameters, with
those provided taking precedence.
- If a `RouteResult` is not composed, or if the composed result does not match
the provided `$routeName`, then only the `$params` provided will be used
for substitutions.
- If no `$params` are provided, and the `$routeName` matches the currently
matched route, then any matched parameters found will be used.
parameters found will be used.
- If no `$params` are provided, and the `$routeName` does not match the
currently matched route, or if no route result is present, then no
substitutions will be made.
- `$queryParams` is an array of query string arguments to include in the
generated URI.
- `$fragmentIdentifier` is a string to use as the URI fragment.
Expand Down
10 changes: 5 additions & 5 deletions doc/book/features/modular-applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ two packages within the default skeleton application:
- [zendframework/zend-config-aggregator](https://github.com/zendframework/zend-config-aggregator),
which provides features for aggregating configuration from a variety of
sources, including:
- PHP files globbed from the filesystem that return an array of configuration.
- [zend-config](https://docs.zendframework.com/zend-config)-compatible
configuration files globbed from the filesystem.
- Configuration provider classes; these are invokable classes which return an
array of configuration.
- PHP files globbed from the filesystem that return an array of configuration.
- [zend-config](https://docs.zendframework.com/zend-config)-compatible
configuration files globbed from the filesystem.
- Configuration provider classes; these are invokable classes which return an
array of configuration.
- [zendframework/zend-component-installer](https://github.com/zendframework/zend-component-installer),
a Composer plugin that looks for an `extra.zf.config-provider` entry in a
package to install, and, if found, adds an entry for that provider to the
Expand Down
8 changes: 4 additions & 4 deletions doc/book/reference/migration/to-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -585,10 +585,10 @@ The ramifications for end users are as follows:

- We have removed the following classes, which either provided final handlers,
or acted as factories for them:
- `Zend\Expressive\TemplatedErrorHandler`
- `Zend\Expressive\WhoopsErrorHandler`
- `Zend\Expressive\Container\TemplatedErrorHandlerFactory`
- `Zend\Expressive\Container\WhoopsErrorHandlerFactory`
- `Zend\Expressive\TemplatedErrorHandler`
- `Zend\Expressive\WhoopsErrorHandler`
- `Zend\Expressive\Container\TemplatedErrorHandlerFactory`
- `Zend\Expressive\Container\WhoopsErrorHandlerFactory`

If you use the `vendor/bin/expressive-pipeline-from-config` tool to migrate your
application to programmatic pipelines, as described below, the `DefaultDelegate`
Expand Down