Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 17, 2025. It is now read-only.

Conversation

@weierophinney
Copy link
Contributor

Changes made for the second review of PSR-7 include allowing empty paths in the URI. This has some implications for Conduit's path matching behavior.

Additionally, a few changes were made to each of the MessageInterface, StreamableInterface (which was renamed to StreamInterface), and the RequestInterface, which required changes in the Conduit decorators for the ServerRequest and Response instances.

This patch includes a couple of new MiddlewarePipe test cases that provide a grid showing expected behavior for path matching; in all, somewhere around 50 new cases are present that describe the various permutations that are allowed and expected.

- Renamed `getHeaderLines()` to `getHeaderLine()` in decorators.
- Updated typehints to reference `StreamInterface` instead of
  `StreamableInterface` for `withBody()` decorators.
- Added `$preserveHost` parameter to `withUri()` implementation.
- Modified docblocks to use `{@inheritdoc}`, and thus reduce redundancy,
  as well as a source of potential error (out-of-sync).
- Fixed Response test expectations with regards to using `getHeader()`
  (now returns an array; used `getHeaderLine()` when testing for strings).
- Middleware should treat both slash and empty path as the root path
- Nested middleware should match only at path boundaries

This latter is designed to ensure that all matches _start_ with a slash,
and that they can match with or without a trailing slash.
- Only match at boundaries.
- Normalize the path to trim a trailing slash when piping middleware;
  this ensures that the path only matches at boundaries, without double
  slashes between segments.
Added variants to each existing test with the suffix "plus", which adds
an additional word to the end of the path to test for matching. In some
situations, this MUST NOT match (e.g., `/foo/barbaz` should not match
against nested `/foo` and `/bar` middlewares), and in others, it should
(e.g., `/foo/bar/baz` should match those same middlewares).
- Run PHPUnit on every version
- Run PHPUnit with code coverage only when on 5.6
- Run phpcs only when on 5.6
- Only upload code coverage to scrutinizer when on 5.6
- Enable (failable) PHP 7 builds
- Enable fast finish mode
- Deprecated, as that's the default behavior now.
weierophinney added a commit that referenced this pull request Apr 22, 2015
@weierophinney weierophinney deleted the feature/psr7-review2 branch April 22, 2015 17:23
@weierophinney weierophinney added this to the 0.15.0 milestone Apr 22, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant