Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit d5812c8

Browse files
committed
Merging develop to master in preparation for 2.0 release
2 parents 8915070 + e260d12 commit d5812c8

File tree

132 files changed

+9703
-5848
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+9703
-5848
lines changed

.docheader

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
22
* @see https://github.com/zendframework/zend-expressive for the canonical source repository
3-
* @copyright Copyright (c) %regexp:(20\d{2}-)20\d{2}% Zend Technologies USA Inc. (http://www.zend.com)
3+
* @copyright Copyright (c) %regexp:(20\d{2}-)?20\d{2}% Zend Technologies USA Inc. (http://www.zend.com)
44
* @license https://github.com/zendframework/zend-expressive/blob/master/LICENSE.md New BSD License
55
*/

.gitattributes

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
/doc export-ignore
22
/test export-ignore
3-
/vendor export-ignore
43
/.gitattributes export-ignore
54
/.gitignore export-ignore
65
/.travis.yml export-ignore
7-
/Makefile export-ignore
86
/mkdocs.yml export-ignore
9-
/NOTES.md export-ignore
107
/phpcs.xml export-ignore
118
/phpunit.xml.dist export-ignore

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ env:
1313
global:
1414
- COMPOSER_ARGS="--no-interaction"
1515
- COVERAGE_DEPS="satooshi/php-coveralls"
16+
- LEGACY_DEPS="phpunit/phpunit"
1617
- SITE_URL=https://zendframework.github.io/zend-expressive
1718
- GH_USER_NAME="Matthew Weier O'Phinney"
1819
@@ -69,10 +70,11 @@ before_install:
6970
- travis_retry composer self-update
7071

7172
install:
72-
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi
73+
- travis_retry composer install $COMPOSER_ARGS --ignore-platform-reqs
74+
- if [[ $TRAVIS_PHP_VERSION =~ ^5.6 ]]; then travis_retry composer update $COMPOSER_ARGS --with-dependencies $LEGACY_DEPS ; fi
7375
- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
7476
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
75-
- travis_retry composer install $COMPOSER_ARGS
77+
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi
7678
- composer show
7779

7880
script:

CHANGELOG.md

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,197 @@
22

33
All notable changes to this project will be documented in this file, in reverse chronological order by release.
44

5+
## 2.0.0 - TBD
6+
7+
### Added
8+
9+
- [#450](https://github.com/zendframework/zend-expressive/pull/450) adds support
10+
for [PSR-11](http://www.php-fig.org/psr/psr-11/); Expressive is now a PSR-11
11+
consumer.
12+
13+
- [#428](https://github.com/zendframework/zend-expressive/pull/428) updates the
14+
zend-stratigility dependency to require `^2.0`; this allows usage of both
15+
the new middleare-based error handling system introduced in zend-stratigility
16+
1.3, as well as usage of [http-interop/http-middleware](https://github.com/http-interop/http-middleware)
17+
implementations with Expressive. The following middleware is now supported:
18+
- Implementations of `Interop\Http\ServerMiddleware\MiddlewareInterface`.
19+
- Callable middleware that implements the same signature as
20+
`Interop\Http\ServerMiddleware\MiddlewareInterface`.
21+
- Callable middleware using the legacy double-pass signature
22+
(`function ($request, $response, callable $next)`); these are now decorated
23+
in `Zend\Stratigility\Middleware\CallableMiddlewareWrapper` instances.
24+
- Service names resolving to any of the above.
25+
- Arrays of any of the above; these will be cast to
26+
`Zend\Stratigility\MiddlewarePipe` instances, piping each middleware.
27+
28+
- [#396](https://github.com/zendframework/zend-expressive/pull/396) adds
29+
`Zend\Expressive\Middleware\NotFoundHandler`, which provides a way to return a
30+
templated 404 response to users. This middleware should be used as innermost
31+
middleware. You may use the new `Zend\Expressive\Container\NotFoundHandlerFactory`
32+
to generate the instance via your DI container.
33+
34+
- [#396](https://github.com/zendframework/zend-expressive/pull/396) adds
35+
`Zend\Expressive\Container\ErrorHandlerFactory`, for generating a
36+
`Zend\Stratigility\Middleware\ErrorHandler` to use with your application.
37+
If a `Zend\Expressive\Middleware\ErrorResponseGenerator` service is present in
38+
the container, it will be used to seed the `ErrorHandler` with a response
39+
generator. If you use this facility, you should enable the
40+
`zend-expressive.raise_throwables` configuration flag.
41+
42+
- [#396](https://github.com/zendframework/zend-expressive/pull/396) adds
43+
`Zend\Expressive\Middleware\ErrorResponseGenerator` and
44+
`Zend\Expressive\Middleware\WhoopsErrorResponseGenerator`, which may be used
45+
with `Zend\Stratigility\Middleware\ErrorHandler` to generate error responses.
46+
The first will generate templated error responses if a template renderer is
47+
composed, and the latter will generate Whoops output.
48+
You may use the new `Zend\Expressive\Container\ErrorResponseGeneratorFactory`
49+
and `Zend\Expressive\Container\WhoopsErrorResponseGeneratorFactory`,
50+
respectively, to create these instances; if you do, assign these to the
51+
service name `Zend\Expressive\Middleware\ErrorResponseGenerator` to have them
52+
automatically registered with the `ErrorHandler`.
53+
54+
- [#396](https://github.com/zendframework/zend-expressive/pull/396) adds
55+
`Zend\Expressive\ApplicationConfigInjectionTrait`, which exposes two methods,
56+
`injectRoutesFromConfig()` and `injectPipelineFromConfig()`; this trait is now
57+
composed into the `Application` class. These methods allow you to configure an
58+
`Application` instance from configuration if desired, and are now used by the
59+
`ApplicationFactory` to configure the `Application` instance.
60+
61+
- [#396](https://github.com/zendframework/zend-expressive/pull/396) adds
62+
a vendor binary, `vendor/bin/expressive-tooling`, which will install (or
63+
uninstall) the [zend-expressive-tooling](https://github.com/zendframework/zend-expressive-tooling);
64+
this package provides migration tools for updating your application to use
65+
programmatic pipelines and the new error handling strategy, as well as tools
66+
for identifying usage of the legacy Stratigility request and response
67+
decorators and error middleware.
68+
69+
- [#413](https://github.com/zendframework/zend-expressive/pull/413) adds the
70+
middleware `Zend\Expressive\Middleware\ImplicitHeadMiddleware`; this
71+
middleware can be used to provide implicit support for `HEAD` requests when
72+
the matched route does not explicitly support the method.
73+
74+
- [#413](https://github.com/zendframework/zend-expressive/pull/413) adds the
75+
middleware `Zend\Expressive\Middleware\ImplicitOptionsMiddleware`; this
76+
middleware can be used to provide implicit support for `OPTIONS` requests when
77+
the matched route does not explicitly support the method; the returned 200
78+
response will also include an `Allow` header listing allowed HTTP methods for
79+
the URI.
80+
81+
- [#426](https://github.com/zendframework/zend-expressive/pull/426) adds the
82+
method `Application::getRoutes()`, which will return the list of
83+
`Zend\Expressive\Router\Route` instances currently registered with the
84+
application.
85+
86+
- [#428](https://github.com/zendframework/zend-expressive/pull/428) adds the
87+
class `Zend\Expressive\Delegate\NotFoundDelegate`, an
88+
`Interop\Http\ServerMiddleware\DelegateInterface` implementation. The class
89+
will return a 404 response; if a `TemplateRendererInterface` is available and
90+
injected into the delegate, it will provide templated contents for the 404
91+
response as well. We also provide `Zend\Expressive\Container\NotFoundDelegateFactory`
92+
for providing an instance.
93+
94+
- [#428](https://github.com/zendframework/zend-expressive/pull/428) adds the
95+
method `Zend\Expressive\Application::getDefaultDelegate()`. This method will
96+
return the default `Interop\Http\ServerMiddleware\DelegateInterface` injected
97+
during instantiation, or, if none was injected, lazy load an instance of
98+
`Zend\Expressive\Delegate\NotFoundDelegate`.
99+
100+
- [#428](https://github.com/zendframework/zend-expressive/pull/428) adds the
101+
constants `DISPATCH_MIDDLEWARE` and `ROUTING_MIDDLEWARE` to
102+
`Zend\Expressive\Application`; they have identical values to the constants
103+
previously defined in `Zend\Expressive\Container\ApplicationFactory`.
104+
105+
- [#428](https://github.com/zendframework/zend-expressive/pull/428) adds
106+
`Zend\Expressive\Middleware\LazyLoadingMiddleware`; this essentially extracts
107+
the logic previously used within `Zend\Expressive\Application` to provide
108+
container-based middleware to allow lazy-loading only when dispatched.
109+
110+
### Changes
111+
112+
- [#440](https://github.com/zendframework/zend-expressive/pull/440) changes the
113+
`Zend\Expressive\Application::__call($method, array $args)` signature; in
114+
previous versions, `$args` did not have a typehint. If you are extending the
115+
class and overriding this method, you will need to update your signature
116+
accordingly.
117+
118+
- [#428](https://github.com/zendframework/zend-expressive/pull/428) updates
119+
`Zend\Expressive\Container\ApplicationFactory` to ignore the
120+
`zend-expressive.raise_throwables` configuration setting; Stratigility 2.X no
121+
longer catches exceptions in its middleware dispatcher, making the setting
122+
irrelevant.
123+
124+
- [#422](https://github.com/zendframework/zend-expressive/pull/422) updates the
125+
zend-expressive-router minimum supported version to 2.0.0.
126+
127+
- [#428](https://github.com/zendframework/zend-expressive/pull/428) modifies the
128+
`Zend\Expressive\Container\ApplicationFactory` constants `DISPATCH_MIDDLEWARE`
129+
and `ROUTING_MIDDLEWARE` to define themselves based on the constants of the
130+
same name now defined in `Zend\Expressive\Application`.
131+
132+
- [#428](https://github.com/zendframework/zend-expressive/pull/428) modifies the
133+
constructor of `Zend\Expressive\Application`; the third argument was
134+
previously a nullable callable `$finalHandler`; it is now a nullable
135+
`Interop\Http\ServerMiddleware\DelegateInterface` with the name
136+
`$defaultDelegate`.
137+
138+
- [#450](https://github.com/zendframework/zend-expressive/pull/450) modifies the
139+
signatures in several classes to typehint against [PSR-11](http://www.php-fig.org/psr/psr-11/)
140+
instead of [container-interop](https://github.com/container-interop/container-interop);
141+
these include:
142+
143+
- `Zend\Expressive\AppFactory::create()`
144+
- `Zend\Expressive\Application::__construct()`
145+
- `Zend\Expressive\Container\ApplicationFactory::__invoke()`
146+
- `Zend\Expressive\Container\ErrorHandlerFactory::__invoke()`
147+
- `Zend\Expressive\Container\ErrorResponseGeneratorFactory::__invoke()`
148+
- `Zend\Expressive\Container\NotFoundDelegateFactory::__invoke()`
149+
- `Zend\Expressive\Container\NotFoundHandlerFactory::__invoke()`
150+
- `Zend\Expressive\Container\WhoopsErrorResponseGeneratorFactory::__invoke()`
151+
- `Zend\Expressive\Container\WhoopsFactory::__invoke()`
152+
- `Zend\Expressive\Container\WhoopsPageHandlerFactory::__invoke()`
153+
154+
- [#450](https://github.com/zendframework/zend-expressive/pull/450) changes the
155+
interface inheritance of `Zend\Expressive\Container\Exception\InvalidServiceException`
156+
to extend `Psr\Container\ContainerExceptionInterface` instead of
157+
`Interop\Container\Exception\ContainerException`.
158+
159+
### Deprecated
160+
161+
- Nothing.
162+
163+
### Removed
164+
165+
- [#428](https://github.com/zendframework/zend-expressive/pull/428) removes the
166+
following routing/dispatch methods from `Zend\Expressive\Application`:
167+
- `routeMiddleware()`; this is now encapsulated in `Zend\Expressive\Middleware\RouteMiddleware`.
168+
- `dispatchMiddleware()`; this is now encapsulated in `Zend\Expressive\Middleware\DispatchMiddleware`.
169+
170+
- [#428](https://github.com/zendframework/zend-expressive/pull/428) removes the
171+
various "final handler" implementations and related factories. Users should
172+
now use the "default delegates" as detailed in sections previous. Classes
173+
and methods removed include:
174+
- `Zend\Expressive\Application::getFinalHandler()`
175+
- `Zend\Expressive\TemplatedErrorHandler`
176+
- `Zend\Expressive\WhoopsErrorHandler`
177+
- `Zend\Expressive\Container\TemplatedErrorHandlerFactory`
178+
- `Zend\Expressive\Container\WhoopsErrorHandlerFactory`
179+
180+
- [#428](https://github.com/zendframework/zend-expressive/pull/428) removes the
181+
`Zend\Expressive\ErrorMiddlewarePipe` class, as zend-stratigility 2.X no
182+
longer defines `Zend\Stratigility\ErrorMiddlewareInterface` or has a concept
183+
of variant-signature error middleware. Use standard middleware to provide
184+
error handling now.
185+
186+
- [#428](https://github.com/zendframework/zend-expressive/pull/428) removes the
187+
exception types `Zend\Expressive\Container\Exception\InvalidArgumentException`
188+
(use `Zend\Expressive\Exception\InvalidArgumentException` instead) and
189+
`Zend\Expressive\Container\Exception\NotFoundException` (which was never used
190+
internally).
191+
192+
### Fixed
193+
194+
- Nothing.
195+
5196
## 1.1.1 - 2017-02-14
6197

7198
### Added

CONTRIBUTING.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,17 @@ To run tests:
4141
- Clone the repository:
4242

4343
```console
44-
$ git clone git@github.com:zendframework/zend-expressive.git
44+
$ git clone git://github.com/zendframework/zend-expressive.git
4545
$ cd zend-expressive
4646
```
4747

4848
- Install dependencies via composer:
4949

5050
```console
51-
$ curl -sS https://getcomposer.org/installer | php --
52-
$ ./composer.phar install
51+
$ composer install
5352
```
5453

55-
If you don't have `curl` installed, you can also download `composer.phar` from https://getcomposer.org/
54+
If you don't have `composer` installed, please download it from https://getcomposer.org/download/
5655

5756
- Run the tests using the "test" command shipped in the `composer.json`:
5857

@@ -80,26 +79,37 @@ $ composer cs-check
8079

8180
To attempt to automatically fix common CS issues:
8281

83-
8482
```console
8583
$ composer cs-fix
8684
```
8785

8886
If the above fixes any CS issues, please re-run the tests to ensure
8987
they pass, and make sure you add and commit the changes after verification.
9088

89+
## Running License Checks
90+
91+
File-level docblocks should follow the format demonstrated in `.docheader`. To
92+
check for conformity, use:
93+
94+
```console
95+
$ composer license-check
96+
```
97+
98+
This will flag files that are incorrect, which you can then update. Re-run the
99+
tool to verify your changes.
100+
91101
## Recommended Workflow for Contributions
92102

93103
Your first step is to establish a public repository from which we can
94104
pull your work into the master repository. We recommend using
95105
[GitHub](https://github.com), as that is where the component is already hosted.
96106

97-
1. Setup a [GitHub account](http://github.com/), if you haven't yet
98-
2. Fork the repository (http://github.com/zendframework/zend-expressive)
107+
1. Setup a [GitHub account](https://github.com/), if you haven't yet
108+
2. Fork the repository (https://github.com/zendframework/zend-expressive)
99109
3. Clone the canonical repository locally and enter it.
100110

101111
```console
102-
$ git clone git://github.com:zendframework/zend-expressive.git
112+
$ git clone git://github.com/zendframework/zend-expressive.git
103113
$ cd zend-expressive
104114
```
105115

@@ -219,7 +229,6 @@ repository, we suggest doing some cleanup of these branches.
219229
$ git push {username} :<branchname>
220230
```
221231

222-
223232
## Conduct
224233

225234
Please see our [CONDUCT.md](CONDUCT.md) to understand expected behavior when interacting with others in the project.

0 commit comments

Comments
 (0)