Updated documentation, added some small changes

This commit is contained in:
TimZ99 2018-07-06 00:28:10 +02:00
parent eac8ebc261
commit 1c984b30ff
No known key found for this signature in database
GPG Key ID: 4D8268DC68E8339D
25 changed files with 34 additions and 32 deletions

View File

@ -317,7 +317,7 @@ function psm_log_uptime($server_id, $status, $latency) {
* @return string parsed message
*/
function psm_parse_msg($status, $type, $vars) {
$status = ($status == true) ? 'on' : 'off';
$status = ($status === true) ? 'on' : 'off';
$message = psm_get_lang('notifications', $status.'_'.$type);
@ -339,7 +339,7 @@ function psm_parse_msg($status, $type, $vars) {
* @param string $href
* @param boolean $header return headers?
* @param boolean $body return body?
* @param int $timeout connection timeout in seconds. defaults to PSM_CURL_TIMEOUT (10 secs).
* @param int|null $timeout connection timeout in seconds. defaults to PSM_CURL_TIMEOUT (10 secs).
* @param boolean $add_agent add user agent?
* @param string|bool $website_username Username website
* @param string|bool $website_password Password website
@ -459,7 +459,7 @@ function psm_update_available() {
$latest = psm_get_conf('version_update_check');
}
if ($latest != false) {
if ($latest !== false) {
$current = psm_get_conf('version');
return version_compare($latest, $current, '>');
} else {
@ -523,7 +523,7 @@ function psm_build_pushover() {
/**
*
* @return \psm\Txtmsg\TxtmsgInterface
* @return \Telegram
*/
function psm_build_telegram() {
$telegram = new \Telegram();

View File

@ -35,7 +35,7 @@ class ServerController extends AbstractServerController {
/**
* Current server id
* @var int $server_id
* @var int|\PDOStatement $server_id
*/
protected $server_id;

View File

@ -61,7 +61,7 @@ class Database {
/**
* PDOStatement of last query
* @var \PDOStatement $last
* @var int|bool|\PDOStatement $last
*/
protected $last;
@ -140,7 +140,7 @@ class Database {
/**
* Execute SQL statement and return number of affected rows
* @param string $query
* @return int
* @return int|\PDOStatement
*/
public function exec($query) {
try {
@ -155,9 +155,9 @@ class Database {
/**
* Prepare and execute SQL statement with parameters
* @param string $query SQL statement
* @param Array $parameters An array of values with as many elements as there are bound parameters in the SQL statement
* @param array $parameters An array of values with as many elements as there are bound parameters in the SQL statement
* @param boolean $fetch automatically fetch results, or return PDOStatement?
* @return @return array|\PDOStatement if $fetch = true, array, otherwise \PDOStatement
* @return array|\PDOStatement if $fetch = true, array, otherwise \PDOStatement
*/
public function execute($query, $parameters, $fetch = true) {
try {

View File

@ -189,8 +189,9 @@ class CMBulkSMS extends Core {
/**
* Create and execute the curl request
*
* @return boolean True if message is sent
* @return boolean|string boolean if message is sent, else string
*/
protected function executeCurlRequest() {
$cr = curl_init();
curl_setopt_array($cr, array(
@ -209,7 +210,7 @@ class CMBulkSMS extends Core {
$cErrorCode = curl_errno($cr);
curl_close($cr);
$this->result = 1;
$this->result = true;
// set result and log error if needed
if ($cError) {
$this->error = 'Response: CM SMS API:'.$cResponse.' cURL Error Code: '.$cErrorCode.'"'.$cError.'"';

View File

@ -49,7 +49,7 @@ class Callr extends Core {
* @var int $success
* @var string $error
*
* @return int or string
* @return bool|string
*/
public function sendSMS($message) {

View File

@ -46,7 +46,7 @@ class ClickSend extends Core {
* @var int $success
* @var string $error
*
* @return int or string
* @return bool|string
*/
public function sendSMS($message) {

View File

@ -41,7 +41,7 @@ class Clickatell extends Core {
* @var int $success
* @var string $error
*
* @return int or string
* @return bool|string
*/
public function sendSMS($message) {

View File

@ -42,7 +42,7 @@ class FreeMobileSMS extends Core {
* @var string $error
* @var string $http_code
*
* @return int or string
* @return bool|string
*/
public function sendSMS($message) {

View File

@ -45,7 +45,7 @@ class FreeVoipDeal extends Core {
* @var int $success
* @var string $error
*
* @return int or string
* @return bool|string
*/
public function sendSMS($message) {

View File

@ -46,7 +46,7 @@ class GatewayAPI extends Core {
* @var int $success
* @var string $error
*
* @return int or string
* @return bool|string
*/
public function sendSMS($message) {

View File

@ -46,7 +46,7 @@ class Inetworx extends Core {
* @var int $success
* @var string $error
*
* @return int or string
* @return bool|string
*/
public function sendSMS($message) {

View File

@ -45,8 +45,9 @@ class Messagebird extends Core {
* @var int $success
* @var string $error
*
* @return int or string
* @return bool|string
*/
public function sendSMS($message) {
$success = 1;
$error = '';

View File

@ -45,8 +45,9 @@ class Mosms extends Core {
* @var int $success
* @var string $error
*
* @return int or string
* @return bool|string
*/
public function sendSMS($message) {
$error = "";
$success = 1;

View File

@ -47,7 +47,7 @@ class Nexmo extends Core {
* @var int $success
* @var string $error
*
* @return int or string
* @return bool|string
*/
public function sendSMS($message) {

View File

@ -50,7 +50,7 @@ class Octopush extends Core {
* @var int $success
* @var string $error
*
* @return int or string
* @return bool|string
*/
public function sendSMS($message) {

View File

@ -45,7 +45,7 @@ class Plivo extends Core {
* @var int $success
* @var string $error
*
* @return int or string
* @return bool|string
*/
public function sendSMS($message) {

View File

@ -46,7 +46,7 @@ class Smsglobal extends Core {
* @var int $success
* @var string $error
*
* @return int or string
* @return bool|string
*/
public function sendSMS($message) {

View File

@ -45,7 +45,7 @@ class Smsgw extends Core {
* @var int $success
* @var string $error
*
* @return int or string
* @return bool|string
*/
public function sendSMS($message) {

View File

@ -46,7 +46,7 @@ class Smsit extends Core {
* @var int $success
* @var string $error
*
* @return int or string
* @return bool|string
*/
public function sendSMS($message) {

View File

@ -46,7 +46,7 @@ class SolutionsInfini extends Core {
* @var int $success
* @var string $error
*
* @return int or string
* @return bool|string
*/
public function sendSMS($message) {

View File

@ -42,7 +42,7 @@ class Spryng extends Core {
* @var int $success
* @var string $error
*
* @return int or string
* @return bool|string
*/
public function sendSMS($message) {

View File

@ -44,7 +44,7 @@ class Textmarketer extends Core {
* @var int $success
* @var string $error
*
* @return int or string
* @return bool|string
*/
public function sendSMS($message) {

View File

@ -44,7 +44,7 @@ class Twilio extends Core {
* @var int $success
* @var string $error
*
* @return int or string
* @return bool|string
*/
public function sendSMS($message) {

View File

@ -47,7 +47,7 @@ class ArchiveManager {
/**
* Retention period
* @var \DateInterval $retention_period
* @var \DateInterval|bool $retention_period false if cleanup is disabled
* @see setRetentionPeriod()
*/
protected $retention_period;

View File

@ -153,7 +153,6 @@ class StatusUpdater {
* @return boolean
*/
protected function updatePing($max_runs, $run = 1) {
$errno = 0;
// save response time
$starttime = microtime(true);
// set ping payload