Spacing, indentation and braces

Co-Authored-By: Scrutinizer Auto-Fixer <auto-fixes@scrutinizer-ci.com>
pull/612/merge
TimZ99 2018-07-05 19:59:57 +02:00
parent a05d36d5f6
commit e2c424e167
No known key found for this signature in database
GPG Key ID: 4D8268DC68E8339D
79 changed files with 2555 additions and 2508 deletions

View File

@ -40,8 +40,9 @@
function psm_get_lang() { function psm_get_lang() {
$args = func_get_args(); $args = func_get_args();
if (empty($args)) if (empty($args)) {
return isset($GLOBALS['sm_lang']) ? $GLOBALS['sm_lang'] : $GLOBALS['sm_lang_default']; return isset($GLOBALS['sm_lang']) ? $GLOBALS['sm_lang'] : $GLOBALS['sm_lang_default'];
}
if (isset($GLOBALS['sm_lang'])) { if (isset($GLOBALS['sm_lang'])) {
$lang = $GLOBALS['sm_lang']; $lang = $GLOBALS['sm_lang'];
@ -54,7 +55,9 @@ function psm_get_lang() {
} }
$lang = $lang[$translation]; $lang = $lang[$translation];
} }
if(!$not_found) return $lang; if (!$not_found) {
return $lang;
}
} }
$lang = $GLOBALS['sm_lang_default']; $lang = $GLOBALS['sm_lang_default'];
@ -727,11 +730,13 @@ function psm_no_cache() {
*/ */
function psm_password_encrypt($key, $password) function psm_password_encrypt($key, $password)
{ {
if(empty($password)) if (empty($password)) {
return ''; return '';
}
if (empty($key)) if (empty($key)) {
throw new \InvalidArgumentException('invalid_encryption_key'); throw new \InvalidArgumentException('invalid_encryption_key');
}
$iv = mcrypt_create_iv( $iv = mcrypt_create_iv(
mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC),
@ -762,11 +767,13 @@ function psm_password_encrypt($key, $password)
*/ */
function psm_password_decrypt($key, $encryptedString) function psm_password_decrypt($key, $encryptedString)
{ {
if(empty($encryptedString)) if (empty($encryptedString)) {
return ''; return '';
}
if (empty($key)) if (empty($key)) {
throw new \InvalidArgumentException('invalid_encryption_key'); throw new \InvalidArgumentException('invalid_encryption_key');
}
$data = base64_decode($encryptedString); $data = base64_decode($encryptedString);
$iv = substr($data, 0, mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC)); $iv = substr($data, 0, mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC));

View File

@ -103,7 +103,9 @@ class UserController extends AbstractController {
// fix server list // fix server list
foreach ($user_servers as $server_id) { foreach ($user_servers as $server_id) {
if (!isset($servers_labels[$server_id])) continue; if (!isset($servers_labels[$server_id])) {
continue;
}
$user['emp_servers'][] = array( $user['emp_servers'][] = array(
'label' => $servers_labels[$server_id] 'label' => $servers_labels[$server_id]
); );

View File

@ -300,7 +300,9 @@ class Database {
* @see insert() * @see insert()
*/ */
public function insertMultiple($table, array $data) { public function insertMultiple($table, array $data) {
if(empty($data)) return false; if (empty($data)) {
return false;
}
// prepare first part // prepare first part
$query = "INSERT INTO `{$table}` "; $query = "INSERT INTO `{$table}` ";

View File

@ -88,7 +88,9 @@ class Callr extends Core {
} }
curl_close($curl); curl_close($curl);
} }
if($success) return 1; if ($success) {
return 1;
}
return $error; return $error;
} }
} }

View File

@ -53,7 +53,9 @@ class ClickSend extends Core {
$error = ""; $error = "";
$success = 1; $success = 1;
if(empty($this->recipients)) return false; if (empty($this->recipients)) {
return false;
}
$data = array('messages' => array()); $data = array('messages' => array());
foreach ($this->recipients as $recipient) { foreach ($this->recipients as $recipient) {
@ -90,7 +92,9 @@ class ClickSend extends Core {
} }
curl_close($curl); curl_close($curl);
if($success) return 1; if ($success) {
return 1;
}
return $error; return $error;
} }
} }

View File

@ -63,7 +63,7 @@ class Clickatell extends Core {
$success = 0; $success = 0;
} }
} }
if($success == 1){ if ($success) {
return 1; return 1;
} }
return $error; return $error;

View File

@ -69,7 +69,9 @@ class FreeMobileSMS extends Core {
} }
curl_close($curl); curl_close($curl);
if($success) return 1; if ($success) {
return 1;
}
return $error; return $error;
} }
} }

View File

@ -79,7 +79,9 @@ class FreeVoipDeal extends Core {
} }
} }
if($success) return 1; if ($success) {
return 1;
}
return $error; return $error;
} }
} }

View File

@ -53,7 +53,9 @@ class GatewayAPI extends Core {
$error = ""; $error = "";
$success = 1; $success = 1;
if(empty($this->recipients)) return false; if (empty($this->recipients)) {
return false;
}
$json = [ $json = [
'sender' => isset($this->originator) ? $this->originator : "PHPServerMon", 'sender' => isset($this->originator) ? $this->originator : "PHPServerMon",
@ -82,7 +84,9 @@ class GatewayAPI extends Core {
$error = $result['code']." - ".$result['message']; $error = $result['code']." - ".$result['message'];
} }
if($success) return 1; if ($success) {
return 1;
}
return $error; return $error;
} }
} }

View File

@ -89,7 +89,9 @@ class Inetworx extends Core {
curl_close($curl); curl_close($curl);
} }
if($success) return 1; if ($success) {
return 1;
}
return $error; return $error;
} }
} }

View File

@ -76,7 +76,7 @@ class Messagebird extends Core {
$success = 0; $success = 0;
} }
} }
if($success == 1){ if ($success) {
return 1; return 1;
} }
return $error; return $error;

View File

@ -81,7 +81,9 @@ class Mosms extends Core {
} }
if($success) return 1; if ($success) {
return 1;
}
return $error; return $error;
} }
} }

View File

@ -84,7 +84,9 @@ class Nexmo extends Core {
} }
if($success) return 1; if ($success) {
return 1;
}
return $error; return $error;
} }
} }

View File

@ -86,7 +86,9 @@ class Octopush extends Core {
} }
curl_close($curl); curl_close($curl);
if($success) return 1; if ($success) {
return 1;
}
return $error; return $error;
} }
} }

View File

@ -52,7 +52,9 @@ class Plivo extends Core {
$error = ""; $error = "";
$success = 1; $success = 1;
if(empty($this->recipients)) return false; if (empty($this->recipients)) {
return false;
}
$recipients = join('<', $this->recipients); $recipients = join('<', $this->recipients);
@ -86,7 +88,9 @@ class Plivo extends Core {
} }
curl_close($curl); curl_close($curl);
if($success) return 1; if ($success) {
return 1;
}
return $error; return $error;
} }
} }

View File

@ -86,7 +86,9 @@ class Smsglobal extends Core {
} }
curl_close($curl); curl_close($curl);
if($success) return 1; if ($success) {
return 1;
}
return $error; return $error;
} }
} }

View File

@ -80,7 +80,9 @@ class Smsgw extends Core {
} }
curl_close($curl); curl_close($curl);
if($success) return 1; if ($success) {
return 1;
}
return $error; return $error;
} }
} }

View File

@ -77,7 +77,9 @@ class Smsit extends Core {
} }
} }
if($success) return 1; if ($success) {
return 1;
}
return $error; return $error;
} }
} }

View File

@ -79,7 +79,9 @@ class SolutionsInfini extends Core {
$error = "HTTP_code: ".$httpcode.".\ncURL error (".$err."): ".curl_strerror($err).". Result: ".$result['status']." - ".$result['message']."."; $error = "HTTP_code: ".$httpcode.".\ncURL error (".$err."): ".curl_strerror($err).". Result: ".$result['status']." - ".$result['message'].".";
} }
curl_close($curl); curl_close($curl);
if($success) return 1; if ($success) {
return 1;
}
return $error; return $error;
} }
} }

View File

@ -36,7 +36,6 @@ class Spryng extends Core {
* @var string $this->username * @var string $this->username
* @var string $this->password * @var string $this->password
* @var string $this->originator * @var string $this->originator
* @var mixed $result * @var mixed $result
* @var array $headers * @var array $headers
* *

View File

@ -72,7 +72,7 @@ class Twilio extends Core {
$success = 0; $success = 0;
} }
} }
if($success == 1){ if ($success) {
return 1; return 1;
} }
return $error; return $error;

View File

@ -290,7 +290,10 @@ class StatusUpdater {
} }
} }
if(!$header_flag) $result = false; // Header was not present if (!$header_flag) {
// Header was not present
$result = false;
}
} }
} }
} }