From 699b015950c8eeeaba43017626308b8fd4df8ffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Jaussoin?= Date: Wed, 5 Oct 2022 16:41:58 +0200 Subject: [PATCH] Fix #45 PHPCS issues Bump the package number --- flexiapi/app/Helpers/Utils.php | 14 ++++++++------ flexisip-account-manager.spec | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/flexiapi/app/Helpers/Utils.php b/flexiapi/app/Helpers/Utils.php index 65110ef..55c0e06 100644 --- a/flexiapi/app/Helpers/Utils.php +++ b/flexiapi/app/Helpers/Utils.php @@ -47,7 +47,7 @@ function bchash(string $username, string $domain, string $password, string $algo { $algos = ['MD5' => 'md5', 'SHA-256' => 'sha256']; - return hash($algos[$algorithm], $username.':'.$domain.':'.$password); + return hash($algos[$algorithm], $username . ':' . $domain . ':' . $password); } function generatePin() @@ -58,7 +58,7 @@ function generatePin() function percent($value, $max) { if ($max == 0) $max = 1; - return round(($value*100)/$max, 2); + return round(($value * 100) / $max, 2); } function markdownDocumentationView($view): string @@ -92,8 +92,8 @@ function getAvailableExternalAccount(): ?ExternalAccount { if (Schema::hasTable('external_accounts')) { return ExternalAccount::where('used', false) - ->where('account_id', null) - ->first(); + ->where('account_id', null) + ->first(); } return null; @@ -114,9 +114,11 @@ function publicRegistrationEnabled(): bool function isRegularExpression($string): bool { - set_error_handler(function() {}, E_WARNING); + set_error_handler(function () { + }, E_WARNING); + $isRegularExpression = preg_match($string, '') !== false; restore_error_handler(); return $isRegularExpression; -} \ No newline at end of file +} diff --git a/flexisip-account-manager.spec b/flexisip-account-manager.spec index a355506..c8fb0e4 100644 --- a/flexisip-account-manager.spec +++ b/flexisip-account-manager.spec @@ -8,7 +8,7 @@ #%define _datadir %{_datarootdir} #%define _docdir %{_datadir}/doc -%define build_number 154 +%define build_number 155 %define var_dir /var/opt/belledonne-communications %define opt_dir /opt/belledonne-communications/share/flexisip-account-manager