PMCORE-593 Action by email: when the authentication is incorrect we can see an error in the routing page.
This commit is contained in:
@@ -43,10 +43,11 @@ class WsResponse
|
||||
* 36 ID_CASE_COULD_NOT_REASSIGNED
|
||||
*
|
||||
* 100 Exception
|
||||
*/
|
||||
*/
|
||||
public $status_code = 0;
|
||||
public $message = '';
|
||||
public $timestamp = '';
|
||||
private $extraParams = [];
|
||||
|
||||
/**
|
||||
* Function __construct
|
||||
@@ -56,11 +57,31 @@ class WsResponse
|
||||
* @param string $message
|
||||
* @return void
|
||||
*/
|
||||
function __construct ($status, $message)
|
||||
public function __construct($status, $message)
|
||||
{
|
||||
$this->status_code = $status;
|
||||
$this->message = $message;
|
||||
$this->timestamp = date( 'Y-m-d H:i:s' );
|
||||
$this->timestamp = date('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get extra parameters for message response.
|
||||
* @return mixed
|
||||
*/
|
||||
public function getExtraParam(string $name)
|
||||
{
|
||||
return isset($this->extraParams[$name]) ? $this->extraParams[$name] : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Add extra parameters for message response.
|
||||
* @param string $name
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
*/
|
||||
public function addExtraParam(string $name, $value): void
|
||||
{
|
||||
$this->extraParams[$name] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,13 +90,12 @@ class WsResponse
|
||||
* @param string $operation
|
||||
* @return string
|
||||
*/
|
||||
function getPayloadString ($operation)
|
||||
public function getPayloadString($operation)
|
||||
{
|
||||
$res = "<$operation>\n";
|
||||
$res .= "<status_code>" . $this->status_code . "</status_code>";
|
||||
$res .= "<message>" . $this->message . "</message>";
|
||||
$res .= "<timestamp>" . $this->timestamp . "</timestamp>";
|
||||
// $res .= "<array>" . $this->timestamp . "</array>";
|
||||
$res .= "<$operation>";
|
||||
return $res;
|
||||
}
|
||||
@@ -85,9 +105,8 @@ class WsResponse
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getPayloadArray ()
|
||||
public function getPayloadArray()
|
||||
{
|
||||
return array ("status_code" => $this->status_code,'message' => $this->message,'timestamp' => $this->timestamp
|
||||
);
|
||||
return ["status_code" => $this->status_code, 'message' => $this->message, 'timestamp' => $this->timestamp];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user