Skip to content
This repository was archived by the owner on Jul 10, 2022. It is now read-only.

Commit 323bf76

Browse files
author
Dominik Zogg
committed
use this as return type
1 parent aadd6b6 commit 323bf76

File tree

7 files changed

+23
-23
lines changed

7 files changed

+23
-23
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This are the differences to the PHP version:
1818
Through [NPM](https://www.npmjs.com) as [@chubbyjs/psr-http-message][1].
1919

2020
```sh
21-
npm i @chubbyjs/[email protected].1
21+
npm i @chubbyjs/[email protected].2
2222
```
2323

2424
## Copyright

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@chubbyjs/psr-http-message",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Common Http-message Interface (PHP FIG PSR-7).",
55
"keywords": [
66
"psr",

src/MessageInterface.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import { Duplex } from 'stream';
22

33
interface MessageInterface {
44
getProtocolVersion(): string;
5-
withProtocolVersion(version: string): MessageInterface;
5+
withProtocolVersion(version: string): this;
66
getHeaders(): Map<string, Array<string>>;
77
hasHeader(name: string): boolean;
88
getHeader(name: string): Array<string>;
99
getHeaderLine(name: string): string;
10-
withHeader(name: string, value: Array<string> | string): MessageInterface;
11-
withAddedHeader(name: string, value: Array<string> | string): MessageInterface;
12-
withoutHeader(name: string): MessageInterface;
10+
withHeader(name: string, value: Array<string> | string): this;
11+
withAddedHeader(name: string, value: Array<string> | string): this;
12+
withoutHeader(name: string): this;
1313
getBody(): Duplex;
14-
withBody(body: Duplex): MessageInterface;
14+
withBody(body: Duplex): this;
1515
}
1616

1717
export default MessageInterface;

src/RequestInterface.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import UriInterface from './UriInterface';
33

44
interface RequestInterface extends MessageInterface {
55
getRequestTarget(): string;
6-
withRequestTarget(requestTarget: string): RequestInterface;
6+
withRequestTarget(requestTarget: string): this;
77
getMethod(): string;
8-
withMethod(name: string): RequestInterface;
8+
withMethod(name: string): this;
99
getUri(): UriInterface;
10-
withUri(uri: UriInterface, preserveHost?: boolean): RequestInterface;
10+
withUri(uri: UriInterface, preserveHost?: boolean): this;
1111
}
1212

1313
export default RequestInterface;

src/ResponseInterface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import MessageInterface from './MessageInterface';
22

33
interface ResponseInterface extends MessageInterface {
44
getStatusCode(): number;
5-
withStatus(code: number, reasonPhrase?: string): ResponseInterface;
5+
withStatus(code: number, reasonPhrase?: string): this;
66
getReasonPhrase(): string;
77
}
88

src/ServerRequestInterface.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ export type ParsedBody = Map<string, ParsedBody> | Array<ParsedBody> | string |
55

66
interface ServerRequestInterface extends RequestInterface {
77
getCookieParams(): Map<string, string>;
8-
withCookieParams(cookieParams: Map<string, string>): ServerRequestInterface;
8+
withCookieParams(cookieParams: Map<string, string>): this;
99
getQueryParams(): QueryParams;
10-
withQueryParams(queryParams: QueryParams): ServerRequestInterface;
10+
withQueryParams(queryParams: QueryParams): this;
1111
getParsedBody(): ParsedBody | undefined;
12-
withParsedBody(parsedBody: ParsedBody | undefined): ServerRequestInterface;
12+
withParsedBody(parsedBody: ParsedBody | undefined): this;
1313
getAttributes(): Map<string, unknown>;
1414
getAttribute(name: string, defaultValue?: unknown): unknown;
15-
withAttribute(name: string, value: unknown): ServerRequestInterface;
16-
withoutAttribute(name: string): ServerRequestInterface;
15+
withAttribute(name: string, value: unknown): this;
16+
withoutAttribute(name: string): this;
1717
}
1818

1919
export default ServerRequestInterface;

src/UriInterface.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ interface UriInterface {
77
getPath(): string;
88
getQuery(): string;
99
getFragment(): string;
10-
withScheme(scheme: string): UriInterface;
11-
withUserInfo(user: string, password?: string): UriInterface;
12-
withHost(scheme: string): UriInterface;
13-
withPort(port?: number): UriInterface;
14-
withPath(scheme: string): UriInterface;
15-
withQuery(scheme: string): UriInterface;
16-
withFragment(scheme: string): UriInterface;
10+
withScheme(scheme: string): this;
11+
withUserInfo(user: string, password?: string): this;
12+
withHost(scheme: string): this;
13+
withPort(port?: number): this;
14+
withPath(scheme: string): this;
15+
withQuery(scheme: string): this;
16+
withFragment(scheme: string): this;
1717
toString(): string;
1818
}
1919

0 commit comments

Comments
 (0)