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

Commit 0bae781

Browse files
committed
Merging develop to master in preparation for 2.0 release
2 parents 786cc5c + 760c6aa commit 0bae781

File tree

129 files changed

+2339
-3012
lines changed

Some content is hidden

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

129 files changed

+2339
-3012
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.tmp/
12
doc/html/
23
vendor/
34
zf-mkdoc-theme/

.travis.yml

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,17 @@ cache:
99
env:
1010
global:
1111
- COMPOSER_ARGS="--no-interaction"
12-
- LEGACY_DEPS="phpunit/phpunit"
1312

1413
matrix:
1514
include:
16-
- php: 5.6
17-
env:
18-
- DEPS=lowest
19-
- php: 5.6
20-
env:
21-
- DEPS=locked
22-
- php: 5.6
23-
env:
24-
- DEPS=latest
25-
- php: 7
26-
env:
27-
- DEPS=lowest
28-
- php: 7
29-
env:
30-
- DEPS=locked
31-
- CHECK_CS=true
32-
- TEST_COVERAGE=true
33-
- INTEGRATION_DEPS="php-coveralls/php-coveralls"
34-
- php: 7
35-
env:
36-
- DEPS=latest
3715
- php: 7.1
3816
env:
3917
- DEPS=lowest
4018
- php: 7.1
4119
env:
4220
- DEPS=locked
21+
- CS_CHECK=true
22+
- TEST_COVERAGE=true
4323
- php: 7.1
4424
env:
4525
- DEPS=latest
@@ -52,26 +32,22 @@ matrix:
5232
- php: 7.2
5333
env:
5434
- DEPS=latest
55-
- php: 7.2
56-
name: Integration tests
35+
- php: nightly
5736
env:
58-
- INTEGRATION_DEPS="http-interop/http-factory-diactoros"
37+
- DEPS=latest
5938

6039
before_install:
61-
- if [[ $TEST_COVERAGE != 'true' && "$(php --version | grep xdebug -ci)" -ge 1 ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
62-
- travis_retry composer self-update
40+
- if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
6341

6442
install:
65-
- travis_retry composer install $COMPOSER_ARGS --ignore-platform-reqs
66-
- if [[ $TRAVIS_PHP_VERSION =~ ^5.6 ]]; then travis_retry composer update $COMPOSER_ARGS --with-dependencies $LEGACY_DEPS ; fi
43+
- travis_retry composer install $COMPOSER_ARGS
6744
- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
6845
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
69-
- if [[ $INTEGRATION_DEPS != '' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $INTEGRATION_DEPS ; fi
7046
- stty cols 120 && composer show
7147

7248
script:
7349
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi
74-
- if [[ $CHECK_CS == 'true' ]]; then composer cs-check ; fi
50+
- if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi
7551

7652
after_script:
7753
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry php vendor/bin/php-coveralls -v ; fi

CHANGELOG.md

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,75 @@
22

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

5-
## 1.8.7 - TBD
5+
## 2.0.0 - 2018-09-27
66

77
### Added
88

9-
- Nothing.
9+
- [#326](https://github.com/zendframework/zend-diactoros/pull/326) adds [PSR-17](https://www.php-fig.org/psr/psr-17/) HTTP Message Factory implementations, including:
10+
11+
- `Zend\Diactoros\RequestFactory`
12+
- `Zend\Diactoros\ResponseFactory`
13+
- `Zend\Diactoros\ServerRequestFactory`
14+
- `Zend\Diactoros\StreamFactory`
15+
- `Zend\Diactoros\UploadedFileFactory`
16+
- `Zend\Diactoros\UriFactory`
17+
18+
These factories may be used to produce the associated instances; we encourage
19+
users to rely on the PSR-17 factory interfaces to allow exchanging PSR-7
20+
implementations within their applications.
21+
22+
- [#328](https://github.com/zendframework/zend-diactoros/pull/328) adds a package-level exception interface, `Zend\Diactoros\Exception\ExceptionInterface`,
23+
and several implementations for specific exceptions raised within the package.
24+
These include:
25+
26+
- `Zend\Diactoros\Exception\DeserializationException` (extends `UnexpectedValueException`)
27+
- `Zend\Diactoros\Exception\InvalidArgumentException` (extends `InvalidArgumentException`)
28+
- `Zend\Diactoros\Exception\InvalidStreamPointerPositionException` (extends `RuntimeException`)
29+
- `Zend\Diactoros\Exception\SerializationException` (extends `UnexpectedValueException`)
30+
- `Zend\Diactoros\Exception\UnreadableStreamException` (extends `RuntimeException`)
31+
- `Zend\Diactoros\Exception\UnrecognizedProtocolVersionException` (extends `UnexpectedValueException`)
32+
- `Zend\Diactoros\Exception\UnrewindableStreamException` (extends `RuntimeException`)
33+
- `Zend\Diactoros\Exception\UnseekableStreamException` (extends `RuntimeException`)
34+
- `Zend\Diactoros\Exception\UntellableStreamException` (extends `RuntimeException`)
35+
- `Zend\Diactoros\Exception\UnwritableStreamException` (extends `RuntimeException`)
36+
- `Zend\Diactoros\Exception\UploadedFileAlreadyMovedException` (extends `RuntimeException`)
37+
- `Zend\Diactoros\Exception\UploadedFileErrorException` (extends `RuntimeException`)
1038

1139
### Changed
1240

13-
- Nothing.
41+
- [#329](https://github.com/zendframework/zend-diactoros/pull/329) adds return type hints and scalar parameter type hints wherever possible.
42+
The changes were done to help improve code quality, in part by reducing manual
43+
type checking. If you are extending any classes, you may need to update your
44+
signatures; check the signatures of the class(es) you are extending for changes.
45+
46+
- [#162](https://github.com/zendframework/zend-diactoros/pull/162) modifies `Serializer\Request` such that it now no longer raises an `UnexpectedValueException` via its `toString()` method
47+
when an unexpected HTTP method is encountered; this can be done safely, as the value can never
48+
be invalid due to other changes in the same patch.
49+
50+
- [#162](https://github.com/zendframework/zend-diactoros/pull/162) modifies `RequestTrait` such that it now invalidates non-string method arguments to either
51+
the constructor or `withMethod()`, raising an `InvalidArgumentException` for any that do not validate.
1452

1553
### Deprecated
1654

1755
- Nothing.
1856

1957
### Removed
2058

21-
- Nothing.
59+
- [#308](https://github.com/zendframework/zend-diactoros/pull/308) removes the following methods from the `ServerRequestFactory` class:
60+
- `normalizeServer()` (use `Zend\Diactoros\normalizeServer()` instead)
61+
- `marshalHeaders()` (use `Zend\Diactoros\marshalHeadersFromSapi()` instead)
62+
- `marshalUriFromServer()` (use `Zend\Diactoros\marshalUriFromSapi()` instead)
63+
- `marshalRequestUri()` (use `Uri::getPath()` from the `Uri` instance returned by `marshalUriFromSapi()` instead)
64+
- `marshalHostAndPortFromHeaders()` (use `Uri::getHost()` and `Uri::getPort()` from the `Uri` instances returned by `marshalUriFromSapi()` instead)
65+
- `stripQueryString()` (use `explode("?", $path, 2)[0]` instead)
66+
- `normalizeFiles()` (use `Zend\Diactoros\normalizeUploadedFiles()` instead)
67+
68+
- [#295](https://github.com/zendframework/zend-diactoros/pull/295) removes `Zend\Diactoros\Server`. You can use the `RequestHandlerRunner` class from
69+
[zendframework/zend-httphandlerrunner](https://docs.zendframework.com/zend-httphandlerrunner) to provide these capabilities instead.
70+
71+
- [#295](https://github.com/zendframework/zend-diactoros/pull/295) removes `Zend\Diactoros\Response\EmitterInterface` and the various emitter implementations.
72+
These can now be found in the package [zendframework/zend-httphandlerrunner](https://docs.zendframework.com/zend-httphandlerrunner/), which also provides
73+
a PSR-7-implementation agnostic way of using them.
2274

2375
### Fixed
2476

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ Develop:
1111
1212
This package supercedes and replaces [phly/http](https://github.com/phly/http).
1313

14-
`zend-diactoros` is a PHP package containing implementations of the [accepted PSR-7 HTTP message interfaces](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-7-http-message.md), as well as a "server" implementation similar to [node's http.Server](http://nodejs.org/api/http.html).
14+
`zend-diactoros` is a PHP package containing implementations of the
15+
[PSR-7 HTTP message interfaces](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-7-http-message.md)
16+
and [PSR-17 HTTP message factory interfaces](https://www.php-fig.org/psr/psr-17).
1517

1618
* File issues at https://github.com/zendframework/zend-diactoros/issues
1719
* Issue patches to https://github.com/zendframework/zend-diactoros/pulls
@@ -20,9 +22,9 @@ This package supercedes and replaces [phly/http](https://github.com/phly/http).
2022

2123
Documentation is available at:
2224

23-
- https://zendframework.github.io/zend-diactoros/
25+
- https://docs.zendframework.com/zend-diactoros/
2426

25-
Source files for documentation are [in the doc/ tree](doc/).
27+
Source files for documentation are [in the docs/ tree](docs/).
2628

2729
[Master]: https://travis-ci.org/zendframework/zend-diactoros
2830
[Master image]: https://secure.travis-ci.org/zendframework/zend-diactoros.svg?branch=master

composer.json

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,45 @@
11
{
22
"name": "zendframework/zend-diactoros",
33
"description": "PSR HTTP Message implementations",
4-
"type": "library",
5-
"license": "BSD-2-Clause",
4+
"license": "BSD-3-Clause",
65
"keywords": [
76
"http",
87
"psr",
98
"psr-7"
109
],
11-
"homepage": "https://github.com/zendframework/zend-diactoros",
1210
"support": {
11+
"docs": "https://docs.zendframework.com/zend-diactoros/",
1312
"issues": "https://github.com/zendframework/zend-diactoros/issues",
14-
"source": "https://github.com/zendframework/zend-diactoros"
13+
"source": "https://github.com/zendframework/zend-diactoros",
14+
"rss": "https://github.com/zendframework/zend-diactoros/releases.atom",
15+
"slack": "https://zendframework-slack.herokuapp.com",
16+
"forum": "https://discourse.zendframework.com/c/questions/exprssive"
1517
},
1618
"config": {
1719
"sort-packages": true
1820
},
1921
"extra": {
2022
"branch-alias": {
21-
"dev-master": "1.8.x-dev",
22-
"dev-develop": "1.9.x-dev",
23-
"dev-release-2.0": "2.0.x-dev"
23+
"dev-master": "2.0.x-dev",
24+
"dev-develop": "2.1.x-dev",
25+
"dev-release-1.8": "1.8.x-dev"
2426
}
2527
},
2628
"require": {
27-
"php": "^5.6 || ^7.0",
29+
"php": "^7.1",
30+
"psr/http-factory": "^1.0",
2831
"psr/http-message": "^1.0"
2932
},
3033
"require-dev": {
3134
"ext-dom": "*",
3235
"ext-libxml": "*",
36+
"http-interop/http-factory-tests": "^0.5.0",
3337
"php-http/psr7-integration-tests": "dev-master",
34-
"phpunit/phpunit": "^5.7.16 || ^6.0.8 || ^7.2.7",
35-
"zendframework/zend-coding-standard": "~1.0"
38+
"phpunit/phpunit": "^7.0.2",
39+
"zendframework/zend-coding-standard": "~1.0.0"
3640
},
3741
"provide": {
42+
"psr/http-factory-implementation": "1.0",
3843
"psr/http-message-implementation": "1.0"
3944
},
4045
"autoload": {
@@ -55,11 +60,7 @@
5560
"autoload-dev": {
5661
"psr-4": {
5762
"ZendTest\\Diactoros\\": "test/"
58-
},
59-
"files": [
60-
"test/TestAsset/Functions.php",
61-
"test/TestAsset/SapiResponse.php"
62-
]
63+
}
6364
},
6465
"scripts": {
6566
"check": [

0 commit comments

Comments
 (0)