WordPress\AiClient\Providers\Http\DTO
Request::__clone
Creates a deep clone of this request.
Clones the headers collection and request options to ensure the cloned request is independent of the original. The HTTP method enum is immutable and can be safely shared.
Method of the class: Request{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Request = new Request(); $Request->__clone();
Changelog
| Since 0.4.2 | Introduced. |
Request::__clone() Request:: clone code WP 7.1.4
public function __clone()
{
// Clone headers collection
$this->headers = clone $this->headers;
// Clone request options if present (contains only primitives)
if ($this->options !== null) {
$this->options = clone $this->options;
}
// Note: $method is an immutable enum and can be safely shared
}