for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Notices class file
*
* @package EBloodBank
* @since 1.0
*/
namespace EBloodBank;
* Notices class
class Notices
{
* The notices list.
* @var array
* @static
private static $notices = [];
* @access private
private function __construct()
}
* Get all notices.
* @return array
public static function getNotices()
return self::$notices;
* Get a notice.
* @return object
public static function getNotice($code)
if (self::isExists($code)) {
return self::$notices[$code];
* Whether a given notice is exists.
* @return bool
public static function isExists($code)
return isset(self::$notices[$code]);
* Add a new notice.
public static function addNotice($code, $msg, $type = 'warning')
if (! $code || self::isExists($code)) {
return false;
self::$notices[$code] = (object) [
'code' => $code,
'type' => $type,
'msg' => $msg,
];
return true;
* Remove an existing notice.
* @return void
public static function removeNotice($code)
if (! $code || ! self::isExists($code)) {
return false
false
void
unset(self::$notices[$code]);
return true
true