[UTILS] Make bitmap not use a static class var and set object properties as lowercase

This commit is contained in:
Hugo Sales 2020-09-10 22:28:50 +00:00 committed by Hugo Sales
parent 147ff89e74
commit 179d7f3335
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
1 changed files with 4 additions and 7 deletions

View File

@ -23,8 +23,6 @@ use App\Util\Exception\ServerException;
abstract class Bitmap
{
public static $consts = null;
public static function _do(int $r, bool $instance)
{
$init = $r;
@ -35,14 +33,13 @@ abstract class Bitmap
$vals = [];
}
if (self::$consts == null) {
self::$consts = (new \ReflectionClass($class))->getConstants();
unset(self::$consts['PREFIX']);
}
$consts = (new \ReflectionClass($class))->getConstants();
unset($consts['PREFIX']);
foreach (self::$consts as $c => $v) {
foreach ($consts as $c => $v) {
$b = ($r & $v) !== 0;
if ($instance) {
$c = strtolower($c);
$obj->{$c} = $b;
}
if ($b) {