Fix issue bugs

This commit is contained in:
Dennis Eichhorn 2017-03-31 20:37:19 +02:00
parent f4b5dd5f01
commit 988a2467af
3 changed files with 13 additions and 15 deletions

View File

@ -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 */
}

View File

@ -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.

View File

@ -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 <d.eichhorn@oms.com>
*/
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 .= '<link rel="stylesheet" type="text/css" href="' . $uri . '">';
} elseif ($type === AssetType::JS) {
$asset .= '<script src="' . $uri . '"></script>';