Request.php in Zircon Profile 8
File
vendor/jcalderonzumba/gastonjs/src/NetworkTraffic/Request.php
View source
<?php
namespace Zumba\GastonJS\NetworkTraffic;
class Request {
protected $data;
protected $responseParts;
public function __construct($data, $responseParts = null) {
$this->data = $data;
$this->responseParts = $this
->createResponseParts($responseParts);
}
protected function createResponseParts($responseParts) {
if ($responseParts === null) {
return array();
}
$responses = array();
foreach ($responseParts as $responsePart) {
$responses[] = new Response($responsePart);
}
return $responses;
}
public function getResponseParts() {
return $this->responseParts;
}
public function setResponseParts($responseParts) {
$this->responseParts = $responseParts;
}
public function getUrl() {
return $this->data['url'];
}
public function getMethod() {
return $this->data['method'];
}
public function getHeaders() {
return $this->data['headers'];
}
public function getTime() {
if (isset($this->data['time'])) {
$requestTime = new \DateTime();
$requestTime
->createFromFormat("Y-m-dTH:i:s.uZ", $this->data["time"]);
return $requestTime;
}
return null;
}
}
Classes
Name |
Description |
Request |
Class Request
@package Zumba\GastonJS\NetworkTraffic |