Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/worker/src/MWP/Event
File: AbstractRequest.php
<?php
[0] Fix | Delete
/*
[1] Fix | Delete
* This file is part of the ManageWP Worker plugin.
[2] Fix | Delete
*
[3] Fix | Delete
* (c) ManageWP LLC <contact@managewp.com>
[4] Fix | Delete
*
[5] Fix | Delete
* For the full copyright and license information, please view the LICENSE
[6] Fix | Delete
* file that was distributed with this source code.
[7] Fix | Delete
*/
[8] Fix | Delete
[9] Fix | Delete
abstract class MWP_Event_AbstractRequest extends Symfony_EventDispatcher_Event
[10] Fix | Delete
{
[11] Fix | Delete
[12] Fix | Delete
private $request;
[13] Fix | Delete
[14] Fix | Delete
/**
[15] Fix | Delete
* @var MWP_Http_ResponseInterface|null
[16] Fix | Delete
*/
[17] Fix | Delete
private $response;
[18] Fix | Delete
[19] Fix | Delete
/**
[20] Fix | Delete
* @param MWP_Worker_Request $request
[21] Fix | Delete
*/
[22] Fix | Delete
public function __construct(MWP_Worker_Request $request)
[23] Fix | Delete
{
[24] Fix | Delete
$this->request = $request;
[25] Fix | Delete
}
[26] Fix | Delete
[27] Fix | Delete
/**
[28] Fix | Delete
* @return MWP_Worker_Request
[29] Fix | Delete
*/
[30] Fix | Delete
public function getRequest()
[31] Fix | Delete
{
[32] Fix | Delete
return $this->request;
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
/**
[36] Fix | Delete
* @return MWP_Http_ResponseInterface
[37] Fix | Delete
*
[38] Fix | Delete
* @throws RuntimeException If the response does not exist.
[39] Fix | Delete
*/
[40] Fix | Delete
public function getResponse()
[41] Fix | Delete
{
[42] Fix | Delete
if ($this->response === null) {
[43] Fix | Delete
throw new RuntimeException('Response is not set');
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
return $this->response;
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
/**
[50] Fix | Delete
* @param MWP_Http_ResponseInterface|null $response
[51] Fix | Delete
*/
[52] Fix | Delete
public function setResponse(MWP_Http_ResponseInterface $response)
[53] Fix | Delete
{
[54] Fix | Delete
$this->response = $response;
[55] Fix | Delete
}
[56] Fix | Delete
[57] Fix | Delete
public function hasResponse()
[58] Fix | Delete
{
[59] Fix | Delete
if ($this->response === null) {
[60] Fix | Delete
return false;
[61] Fix | Delete
}
[62] Fix | Delete
[63] Fix | Delete
return true;
[64] Fix | Delete
}
[65] Fix | Delete
}
[66] Fix | Delete
[67] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function