Files
roundcubemail/plugins/enigma/lib/enigma_error.php
Michael Voříšek 6a53a1d853 Fix CS (whitespace, visibility) (#9297)
* Fix "method_argument_space"

* Fix "control_structure_continuation_position"

* Fix "new_with_parentheses"

* Fix "blank_line_before_statement"

* Fix "visibility_required"

* Fix some "array_indentation"

* Fix some "array_indentation" - unify all "rcube::raise_error" calls

* rm useless eslint ignores and add rules counts

* sort eslint ignores

* fix eslint ignores grammar

* Revert "Fix "blank_line_before_statement""

* fix CS 3.46.0
2024-01-04 14:26:35 +01:00

61 lines
1.7 KiB
PHP

<?php
/*
+-------------------------------------------------------------------------+
| Error class for the Enigma Plugin |
| |
| Copyright (C) The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
| See the README file for a full license statement. |
+-------------------------------------------------------------------------+
| Author: Aleksander Machniak <alec@alec.pl> |
+-------------------------------------------------------------------------+
*/
class enigma_error
{
private $code;
private $message;
private $data = [];
// error codes
public const OK = 0;
public const INTERNAL = 1;
public const NODATA = 2;
public const KEYNOTFOUND = 3;
public const DELKEY = 4;
public const BADPASS = 5;
public const EXPIRED = 6;
public const UNVERIFIED = 7;
public const NOMDC = 8;
public function __construct($code = null, $message = '', $data = [])
{
$this->code = $code;
$this->message = $message;
$this->data = $data;
}
public function getCode()
{
return $this->code;
}
public function getMessage()
{
return $this->message;
}
public function getData($name = null)
{
if ($name) {
return $this->data[$name] ?? null;
}
return $this->data;
}
}