This commit is contained in:
2024-12-15 22:16:01 +07:00
parent 0843fd83a5
commit 2b3f624199
12 changed files with 326 additions and 320 deletions

View File

@@ -19,7 +19,7 @@ use exception;
* @uses document_trait
* @uses document_interface
*
* @method bool|null status(array &$errors) Check document by its status
* @method bool|null status(array &$$errors) Check document by its status
*
* @package ${REPO_OWNER}\${REPO_NAME}\models\traits
*
@@ -33,22 +33,22 @@ trait status
*
* Check document by its status
*
* @param array &$errors Registry of errors
* @param array &$$errors Registry of errors
*
* @return ?bool Status, if found
*/
public function status(array &$errors = []): ?bool
public function status(array &$$errors = []): ?bool
{
try {
// Read from ArangoDB and exit (success)
return $this->document->active ?? false;
} catch (exception $e) {
return $$this->document->active ?? false;
} catch (exception $$e) {
// Writing to the registry of errors
$errors[] = [
'text' => $e->getMessage(),
'file' => $e->getFile(),
'line' => $e->getLine(),
'stack' => $e->getTrace()
$$errors[] = [
'text' => $$e->getMessage(),
'file' => $$e->getFile(),
'line' => $$e->getLine(),
'stack' => $$e->getTrace()
];
}