PHP 8.4 + MINIMAL 3.2.0 + many improvements
This commit is contained in:
24
author/project/system/models/traits/status.php
Normal file → Executable file
24
author/project/system/models/traits/status.php
Normal file → Executable file
@@ -4,24 +4,38 @@ declare(strict_types=1);
|
||||
|
||||
namespace ${REPO_OWNER}\${REPO_NAME}\models\traits;
|
||||
|
||||
// Files of the project
|
||||
use ${REPO_OWNER}\${REPO_NAME}\models\traits\document as document_trait,
|
||||
${REPO_OWNER}\${REPO_NAME}\models\interfaces\document as document_interface;
|
||||
|
||||
// Built-in libraries
|
||||
use exception;
|
||||
|
||||
/**
|
||||
* Trait fo initialization of a status
|
||||
* Status (DUMB SHIT)
|
||||
*
|
||||
* Trait for initialization of a status
|
||||
*
|
||||
* @uses document_trait
|
||||
* @uses document_interface
|
||||
*
|
||||
* @method bool|null status(array &$errors) Check document by its status
|
||||
*
|
||||
* @package ${REPO_OWNER}\${REPO_NAME}\models\traits
|
||||
*
|
||||
* @author ${REPO_OWNER} < mail >
|
||||
* @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License
|
||||
* @author ${REPO_OWNER} <mail@domain.zone>
|
||||
*/
|
||||
trait status
|
||||
{
|
||||
/**
|
||||
* Initialize of a status
|
||||
* Status
|
||||
*
|
||||
* Check document by its status
|
||||
*
|
||||
* @param array &$errors Registry of errors
|
||||
*
|
||||
* @return ?bool Status, if they are found
|
||||
* @return ?bool Status, if found
|
||||
*/
|
||||
public function status(array &$errors = []): ?bool
|
||||
{
|
||||
@@ -29,7 +43,7 @@ trait status
|
||||
// Read from ArangoDB and exit (success)
|
||||
return $this->document->active ?? false;
|
||||
} catch (exception $e) {
|
||||
// Write to the registry of errors
|
||||
// Writing to the registry of errors
|
||||
$errors[] = [
|
||||
'text' => $e->getMessage(),
|
||||
'file' => $e->getFile(),
|
||||
|
Reference in New Issue
Block a user