From f77d01a373e201c8726f86feb3cacdcfcb2809a5 Mon Sep 17 00:00:00 2001 From: "Abdulmhsen B. A. A" Date: Fri, 10 Jun 2022 17:33:35 +0300 Subject: [PATCH] Added common response/error objects for inner communication between backend clients and their sub actions. --- src/Backends/Common/Response.php | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/Backends/Common/Response.php diff --git a/src/Backends/Common/Response.php b/src/Backends/Common/Response.php new file mode 100644 index 00000000..293362e4 --- /dev/null +++ b/src/Backends/Common/Response.php @@ -0,0 +1,48 @@ +error; + } + + /** + * Return Error response. + */ + public function getError(): Error + { + return $this->error ?? new Error('No error logged.'); + } + + /** + * Is the Operation Successful? + */ + public function isSuccessful(): bool + { + return $this->status; + } +}