diff --git a/Auth/LoginReturnType.php b/Auth/LoginReturnType.php index 57f78ce2d..345303e36 100644 --- a/Auth/LoginReturnType.php +++ b/Auth/LoginReturnType.php @@ -35,13 +35,13 @@ use phpOMS\Datatypes\Enum; abstract class LoginReturnType extends Enum { /* public */ const OK = 0; /* Everything is ok and the user got authed */ - /* public */ const FAILURE = 1; /* Authentication resulted in a unexpected failure */ - /* public */ const WRONG_PASSWORD = 2; /* Authentication with wrong password */ - /* public */ const WRONG_USERNAME = 3; /* Authentication with unknown user */ - /* public */ const WRONG_PERMISSION = 4; /* User doesn't have permission to authenticate */ - /* public */ const NOT_ACTIVATED = 5; /* The user is not activated yet */ - /* public */ const WRONG_INPUT_EXCEEDED = 6; /* Too many wrong logins recently */ - /* public */ const TIMEOUTED = 7; /* User received a timeout and can not log in until a certain date */ - /* public */ const BANNED = 8; /* User is banned */ - /* public */ const INACTIVE = 9; /* User is inactive */ + /* public */ const FAILURE = -1; /* Authentication resulted in a unexpected failure */ + /* public */ const WRONG_PASSWORD = -2; /* Authentication with wrong password */ + /* public */ const WRONG_USERNAME = -3; /* Authentication with unknown user */ + /* public */ const WRONG_PERMISSION = -4; /* User doesn't have permission to authenticate */ + /* public */ const NOT_ACTIVATED = -5; /* The user is not activated yet */ + /* public */ const WRONG_INPUT_EXCEEDED = -6; /* Too many wrong logins recently */ + /* public */ const TIMEOUTED = -7; /* User received a timeout and can not log in until a certain date */ + /* public */ const BANNED = -8; /* User is banned */ + /* public */ const INACTIVE = -9; /* User is inactive */ } diff --git a/Event/EventManager.php b/Event/EventManager.php index 9618a288f..ee10c1ba1 100644 --- a/Event/EventManager.php +++ b/Event/EventManager.php @@ -17,8 +17,6 @@ declare(strict_types=1); namespace phpOMS\Event; -use phpOMS\Pattern\Mediator; - /** * EventManager class. * @@ -32,7 +30,7 @@ use phpOMS\Pattern\Mediator; * * @todo : make cachable + database storable -> can reload user defined listeners (persistent events) */ -class EventManager implements Mediator +class EventManager { /** * Events. diff --git a/Model/Html/Head.php b/Model/Html/Head.php index 89362fece..38d2c23fd 100644 --- a/Model/Html/Head.php +++ b/Model/Html/Head.php @@ -148,7 +148,7 @@ class Head implements RenderableInterface /** * Set page title. * - * @param string $type Asset type + * @param int $type Asset type * @param string $uri Asset uri * * @return void @@ -156,7 +156,7 @@ class Head implements RenderableInterface * @since 1.0.0 * @author Dennis Eichhorn */ - public function addAsset(string $type, string $uri) /* : void */ + public function addAsset(int $type, string $uri) /* : void */ { $this->assets[$uri] = $type; } @@ -308,7 +308,7 @@ class Head implements RenderableInterface { $asset = ''; foreach ($this->assets as $uri => $type) { - if ($type == AssetType::CSS) { + if ($type === AssetType::CSS) { $asset .= ''; } elseif ($type === AssetType::JS) { $asset .= '';