Skip to content

Commit

Permalink
Merge pull request #84 from fezfez/php8.4
Browse files Browse the repository at this point in the history
Allow PHP 8.4
  • Loading branch information
gsteel authored Oct 18, 2024
2 parents 26dd6d1 + f16526f commit a66bfb6
Show file tree
Hide file tree
Showing 9 changed files with 281 additions and 253 deletions.
2 changes: 1 addition & 1 deletion .laminas-ci.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"ignore_php_platform_requirements": {
"8.3": true
"8.4": true
}
}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"sort-packages": true
},
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
"laminas/laminas-loader": "^2.10",
"laminas/laminas-stdlib": "^3.6",
"laminas/laminas-uri": "^2.11",
Expand All @@ -32,7 +32,7 @@
"require-dev": {
"ext-curl": "*",
"laminas/laminas-coding-standard": "~2.4.0",
"phpunit/phpunit": "^9.5.25"
"phpunit/phpunit": "^9.6.21"
},
"suggest": {
"paragonie/certainty": "For automated management of cacert.pem"
Expand Down
384 changes: 208 additions & 176 deletions composer.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/book/client/cookies.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ Besides the methods demonstrated in the examples, `Laminas\Http\Cookies` defines
Method signature | Description
------------------------------------------------------------------- | -----------
`static fromResponse(Response $response, string $refUri) : Cookies` | Create a `Cookies` instance from a response and the request URI. Parses all `Set-Cookie` headers, maps them to the URI, and aggregates them.
`addCookie(string|SetCookie $cookie, string $refUri = null) : void` | Add a cookie, mapping it to the given URI. If no URI is provided, it will be inferred from the cookie value's domain and path.
`addCookie(string\|SetCookie $cookie, string $refUri = null) : void` | Add a cookie, mapping it to the given URI. If no URI is provided, it will be inferred from the cookie value's domain and path.
`addCookiesFromResponse(Response $response, string $refUri) : void` | Add all `Set-Cookie` values from the provided response, mapping to the given URI.
`getAllCookies(int $retAs = self::COOKIE_OBJECT) : array|string` | Retrieve all cookies. Returned array will have either `SetCookie` instances (the default), strings for each `Set-Cookie` declaration, or a single string containing all declarations, based on the `COOKIE_*` constant used.
`getCookie(/* ... */) : string|SetCookie` | Retrieve a single cookie by name for the given URI. See below for argument details.
`getAllCookies(int $retAs = self::COOKIE_OBJECT) : array\|string` | Retrieve all cookies. Returned array will have either `SetCookie` instances (the default), strings for each `Set-Cookie` declaration, or a single string containing all declarations, based on the `COOKIE_*` constant used.
`getCookie(/*...*/) : string\|SetCookie` | Retrieve a single cookie by name for the given URI. See below for argument details.
`getMatchingCookies(/* ... */) : array` | See below for details.
`isEmpty() : bool` | Whether or not the instance aggregates any cookies currently.
`reset() : void` | Clear all aggregated cookies from the instance.
Expand Down
106 changes: 53 additions & 53 deletions docs/book/headers.md

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/book/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ abstractions:

- Context-less `Request` and `Response` classes that expose a fluent API for
introspecting several aspects of HTTP messages:
- Request line information and response status information
- Parameters, such as those found in POST and GET
- Message Body
- Headers
- Request line information and response status information
- Parameters, such as those found in POST and GET
- Message Body
- Headers
- A client implementation with various adapters that allow for sending requests
and introspecting responses.

> ### Not PSR-7!
> ## Not PSR-7
>
> This library **does not** support [PSR-7](http://www.php-fig.org/psr/psr-7), as
> it predates that specification. For PSR-7 support, please see our
Expand Down
14 changes: 7 additions & 7 deletions docs/book/request.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,22 @@ Method signature | De
`static fromString(string $string) : Request` | A factory that produces a `Request` object from a well-formed HTTP request message string.
`setMethod(string $method) : self` | Set the method for this request.
`getMethod() : string` | Return the method for this request.
`setUri(string|Uri $uri) : self` | Set the URI/URL for this request; this can be a string or an instance of `Laminas\Uri\Http`.
`setUri(string\|Uri $uri) : self` | Set the URI/URL for this request; this can be a string or an instance of `Laminas\Uri\Http`.
`getUri() : Uri` | Return the URI for this request object.
`getUriString() : string` | Return the URI for this request object as a string.
`setVersion(string $version) : self` | Set the HTTP version for this object, one of 1.0, 1.1 or 2 (`Request::VERSION_10`, `Request::VERSION_11`, `Request::VERSION_2`). HTTP/2 support was added in laminas-http 2.10.0.
`getVersion() : string` | Return the HTTP version for this request.
`setQuery(Parameters $query) : self` | Provide an alternate Parameter Container implementation for query parameters in this object. (This is NOT the primary API for value setting; for that, see `getQuery()`).
`getQuery(string|null $name, mixed|null $default) : null|string|Parameters` | Return the parameter container responsible for query parameters or a single query parameter based on `$name`.
`getQuery(string\|null $name, mixed\|null $default) : null\|string\|Parameters` | Return the parameter container responsible for query parameters or a single query parameter based on `$name`.
`setPost(Parameters $post) : self` | Provide an alternate Parameter Container implementation for POST parameters in this object. (This is NOT the primary API for value setting; for that, see `getPost()`).
`getPost(string|null $name, mixed|null $default) : null|string|Parameters` | Return the parameter container responsible for POST parameters or a single POST parameter, based on `$name`.
`getPost(string\|null $name, mixed\|null $default) : null\|string\|Parameters` | Return the parameter container responsible for POST parameters or a single POST parameter, based on `$name`.
`getCookie() : Header\Cookie` | Return the Cookie header, this is the same as calling `$request->getHeaders()->get('Cookie');`.
`setFiles(Parameters $files) : self` | Provide an alternate Parameter Container implementation for file parameters in this object, (This is NOT the primary API for value setting; for that, see `getFiles()`).
`getFiles(string|null $name, mixed|null $default) : null|string|Parameters` | Return the parameter container responsible for file parameters or a single file parameter, based on `$name`.
`getFiles(string\|null $name, mixed\|null $default) : null\|string\|Parameters` | Return the parameter container responsible for file parameters or a single file parameter, based on `$name`.
`setHeaders(Headers $headers) : self` | Provide an alternate Parameter Container implementation for headers in this object, (this is NOT the primary API for value setting, for that see `getHeaders()`).
`getHeaders(string|null $name, mixed|null $default) : mixed` | Return the container responsible for storing HTTP headers. This container exposes the primary API for manipulating headers set in the HTTP request. See the section on [Headers](headers.md) for more information. Return value is based on `$name`; `null` returns `Headers`, while a matched header returns a `Header\HeaderInterface` implementation for single-value headers or an `ArrayIterator` for multi-value headers.
`setMetadata(string|int|array|Traversable $spec, mixed $value) : self` | Set message metadata. Non-destructive setting of message metadata; always adds to the metadata, never overwrites the entire metadata container.
`getMetadata(null|string|int $key, null|mixed $default) : mixed` | Retrieve all metadata or a single metadatum as specified by key.
`getHeaders(string\|null $name, mixed\|null $default) : mixed` | Return the container responsible for storing HTTP headers. This container exposes the primary API for manipulating headers set in the HTTP request. See the section on [Headers](headers.md) for more information. Return value is based on `$name`; `null` returns `Headers`, while a matched header returns a `Header\HeaderInterface` implementation for single-value headers or an `ArrayIterator` for multi-value headers.
`setMetadata(string\|int\|array\|Traversable $spec, mixed $value) : self` | Set message metadata. Non-destructive setting of message metadata; always adds to the metadata, never overwrites the entire metadata container.
`getMetadata(null\|string\|int $key, null\|mixed $default) : mixed` | Retrieve all metadata or a single metadatum as specified by key.
`setContent(mixed $value) : self` | Set request body (content).
`getContent() : mixed` | Get request body (content).
`isOptions() : bool` | Is this an OPTIONS method request?
Expand Down
4 changes: 2 additions & 2 deletions docs/book/response.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ Method signature | Descrip
`decodeChunkedBody(string $body) : string` | Decode a "chunked" transfer-encoded body and return the decoded text.
`decodeGzip(string $body) : string` | Decode a gzip encoded message (when `Content-Encoding` indicates gzip). Currently requires PHP with zlib support.
`decodeDeflate(string $body) : string` | Decode a zlib deflated message (when `Content-Encoding` indicates deflate). Currently requires PHP with zlib support.
`setMetadata(string|int|array|Traversable $spec, mixed $value) : self` | Non-destructive setting of message metadata; always adds to the metadata, never overwrites the entire metadata container.
`getMetadata(null|string|int $key, null|mixed $default) : mixed` | Retrieve all metadata or a single metadatum as specified by key.
`setMetadata(string\|int\|array\|Traversable $spec, mixed $value) : self` | Non-destructive setting of message metadata; always adds to the metadata, never overwrites the entire metadata container.
`getMetadata(null\|string\|int $key, null\|mixed $default) : mixed` | Retrieve all metadata or a single metadatum as specified by key.
`setContent(mixed $value) : self` | Set message content.
`getContent() : mixed` | Get raw message content.
`getBody() : mixed` | Get decoded message content.
Expand Down
4 changes: 0 additions & 4 deletions test/Client/_files/Laminas7683-chunked.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,3 @@
// intentional use of case-insensitive header name
header('Transfer-encoding: chunked');
header('content-encoding: gzip');
flush();

// terminate chunked transfer properly
echo "00\r\n\r\n";

0 comments on commit a66bfb6

Please sign in to comment.