Skip to content
Code-Schnipsel Gruppen Projekte
Bestätigt Commit 5b2a046a erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

refactor: uuid hash refactor

Übergeordneter 8025023e
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
3 Merge Requests!87refactor: code stability,!86refactor: code stability,!85refactor: code stability
......@@ -60,10 +60,10 @@ public function __construct(?array $comments = [])
/**
* Creates a comment list from a stored representation
*
* @param string|array $data
* @param array|string $data
* @return Comments
*/
public static function unserialize($data): Comments
public static function unserialize(array|string $data): Comments
{
if (is_string($data)) {
$data = json_decode($data, true);
......@@ -125,6 +125,7 @@ public function toArray(): array
* @param string $source - optional, name of the package
* @param string $sourceIcon - optional, source icon
* @param bool|string $id - optional, comment id, if needed, it will set one
* @param bool|string $objectHash
*/
public function addComment(
string $message,
......@@ -133,7 +134,7 @@ public function addComment(
string $sourceIcon = '',
bool|string $id = false,
bool|string $objectHash = false
) {
): void {
if ($time === false) {
$time = time();
}
......
......@@ -22,17 +22,17 @@ class Debug
protected static ?Debug $Instance = null;
/**
* @var QUI\Config
* @var ?QUI\Config
*/
protected $Config;
protected QUI\Config|null $Config = null;
/**
* @var int
* @var int|bool
*/
protected $debug = false;
protected int|bool $debug = false;
/**
* @return Debug
* @return Debug|null
*/
public static function getInstance(): ?Debug
{
......@@ -62,7 +62,7 @@ public function __construct()
/**
* Enable the debugging
*/
public function enable()
public function enable(): void
{
$this->debug = 1;
}
......@@ -70,7 +70,7 @@ public function enable()
/**
* Disable the debugging
*/
public function disable()
public function disable(): void
{
$this->debug = 0;
}
......@@ -79,10 +79,10 @@ public function disable()
* Send debug logs
* only if debugging is true
*
* @param object|string|integer|array $value - debug data
* @param string|bool $source - debug source
* @param object|integer|array|string $value - debug data
* @param bool|string $source - debug source
*/
public function log($value, $source = false)
public function log(object|int|array|string $value, bool|string $source = false): void
{
if (!$this->debug) {
return;
......
......@@ -42,10 +42,10 @@ public static function conf(string $section, string $key)
{
try {
$Package = QUI::getPackage('quiqqer/erp');
$Config = $Package->getConfig();
$Config = $Package->getConfig();
return $Config->get($section, $key);
} catch (QUI\Exception $Exception) {
} catch (QUI\Exception) {
}
return false;
......@@ -59,21 +59,21 @@ public static function conf(string $section, string $key)
*/
public static function getArea(): Areas\Area
{
$Areas = new QUI\ERP\Areas\Handler();
$Package = QUI::getPackage('quiqqer/tax');
$Config = $Package->getConfig();
$Areas = new QUI\ERP\Areas\Handler();
$Package = QUI::getPackage('quiqqer/tax');
$Config = $Package->getConfig();
$standardArea = $Config->getValue('shop', 'area');
try {
$Area = $Areas->getChild($standardArea);
} catch (QUI\Exception $Exception) {
} catch (QUI\Exception) {
QUI\System\Log::addError(
'The ecoyn default area was not found. Please check your ecoyn area settings.'
);
// use area from default country
$Country = self::getCountry();
$Area = QUI\ERP\Areas\Utils::getAreaByCountry($Country);
$Area = QUI\ERP\Areas\Utils::getAreaByCountry($Country);
}
/* @var $Area QUI\ERP\Areas\Area */
......@@ -119,14 +119,14 @@ public static function getUserCurrency(QUI\Interfaces\Users\User $User = null):
try {
$Package = QUI::getPackage('quiqqer/erp');
$Config = $Package->getConfig();
$Config = $Package->getConfig();
self::$userRelatedCurrency = $Config->get('general', 'userRelatedCurrency');
if (!self::$userRelatedCurrency) {
return self::getCurrency();
}
} catch (QUI\Exception $Exception) {
} catch (QUI\Exception) {
}
return QUI\ERP\Currency\Handler::getUserCurrency($User);
......@@ -141,8 +141,8 @@ public static function getBruttoNettoStatus(): int
{
try {
$Package = QUI::getPackage('quiqqer/tax');
$Config = $Package->getConfig();
} catch (QUI\Exception $Exception) {
$Config = $Package->getConfig();
} catch (QUI\Exception) {
return QUI\ERP\Utils\User::IS_BRUTTO_USER;
}
......@@ -164,7 +164,7 @@ public static function getPrecision(): int
{
try {
$Package = QUI::getPackage('quiqqer/erp');
$Config = $Package->getConfig();
$Config = $Package->getConfig();
if (!$Config) {
return 8;
......@@ -202,7 +202,7 @@ public static function getTimestampFormat($lang = false)
try {
$Package = QUI::getPackage('quiqqer/erp');
$Config = $Package->getConfig();
$Config = $Package->getConfig();
} catch (QUI\Exception $Exception) {
QUI\System\Log::writeException($Exception);
......@@ -238,7 +238,7 @@ public static function getDateFormat($lang = false): string
try {
$Package = QUI::getPackage('quiqqer/erp');
$Config = $Package->getConfig();
$Config = $Package->getConfig();
} catch (QUI\Exception $Exception) {
QUI\System\Log::writeException($Exception);
......@@ -265,7 +265,7 @@ public static function getLogo()
{
try {
$Config = QUI::getPackage('quiqqer/erp')->getConfig();
$logo = $Config->get('general', 'logo');
$logo = $Config->get('general', 'logo');
if (!empty($logo)) {
return QUI\Projects\Media\Utils::getImageByUrl($logo);
......
......@@ -19,7 +19,6 @@
use function get_class;
use function is_array;
use function is_bool;
use function is_numeric;
use function json_decode;
use function trim;
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren