Factory
Factory
Tags
Table of Contents
- $instance : self|null
- Instance.
- $fakes : array<string|int, callable>
- Fakes.
- __construct() : mixed
- Construct factory.
- fake() : void
- Fake.
- instance() : self
- Instance.
- pre_http_request() : false|array<string|int, mixed>|WP_Error
- Pre HTTP request
Properties
$instance
Instance.
protected
static self|null
$instance
$fakes
Fakes.
private
array<string|int, callable>
$fakes
Methods
__construct()
Construct factory.
public
__construct() : mixed
Return values
mixed —fake()
Fake.
public
fake(string $url, string|callable $callback) : void
Parameters
- $url : string
-
URL.
- $callback : string|callable
-
Callback.
Tags
Return values
void —instance()
Instance.
public
static instance() : self
Return values
self —pre_http_request()
Pre HTTP request
public
pre_http_request(false|array<string|int, mixed>|WP_Error $preempt, array<string, string> $r, string $url) : false|array<string|int, mixed>|WP_Error
Parameters
- $preempt : false|array<string|int, mixed>|WP_Error
-
Whether to preempt an HTTP request's return value. Default false.
- $r : array<string, string>
-
HTTP request arguments.
- $url : string
-
The request URL.