-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve WebAPI compatibility #40
Comments
Before any of this can be completed, the |
FormData class was left as a stub in the repository which is now failing PHPStan. Here's the class: <?php
namespace Gt\Http;
class FormData {
/** @var array */
protected $data;
public function __construct(array $data = []) {
$this->data = $data;
}
public function append(
string $key,
string $value,
string $filename = null
):void {
}
public function set(
string $name,
string $value,
string $filename = null
):void {
}
public function delete(string $name):void {
}
public function entries():array {
}
public function get(string $name):?string {
}
public function getAll(string $name):array {
}
/** For consistency with naming of other Web APIs. */
public function contains(string $name):bool {
}
public function has(string $name):bool {
}
public function keys():array {
}
public function values():array {
}
} |
Different Body types that need implementing:
|
This latest push has implementations of some of the classes, and properties have been made consistent. Still to do:
|
https://developer.mozilla.org/en-US/docs/Web/API
There are a few classes in the WebAPI that have functionality shared by this implementation of PSR-7 which should be implemented.
Functions:
Message::arrayBuffer()
- Returns a promiseMessage::blob()
- Returns a promiseMessage::formData()
- Returns a promiseMessage::json()
- Returns a promiseMessage::text()
- Returns a promiseProperties:
Response::ok
Response::headers
Response::redirected
Response::status
Response::statusText
Response::type
Response::uri
Response::useFinalUri
Request::cache
Request::context
Request::credentials
Request::destination
Request::headers
Request::integrity
Request::method
Request::mode
Request::redirect
Request::referrer
Request::referrerPolicy
Request::url
The
Headers
class needs to have its methods made compatible (https://developer.mozilla.org/en-US/docs/Web/API/Headers).The
FormData
class needs fully implementing.The
Stream
class should be broken down intoReadableStream
andWritableStream
.The text was updated successfully, but these errors were encountered: