Skip to content
Snippets Groups Projects

fix shooker warnings

Merged Hahn Axel (hahn) requested to merge 5591-remove-warnings into master
1 file
+ 10
8
Compare changes
  • Side-by-side
  • Inline
@@ -42,14 +42,16 @@ class messenger {
@@ -42,14 +42,16 @@ class messenger {
}
}
/**
/**
* send an email if _aCfg['email'] exists
* send an email if _aCfg['email']['to'] exists
*/
*/
private function _sendEmail(){
private function _sendEmail(){
if (array_key_exists('email', $this->_aCfg) && array_key_exists('to', $this->_aCfg['email'])
if (isset($this->_aCfg['email']['to']) && $this->_aCfg['email']['to']) {
) {
preg_match('/^(.*)\n/', $this->_sMessage, $aTmp);
preg_match('/^(.*)\n/', $this->_sMessage, $aTmp);
$sSubject = $aTmp[0];
$sSubject = $aTmp[0];
return mail($this->_aCfg['email']['to'], $sSubject, $this->_sMessage, "From: " . $this->_aCfg['email']['from'] . "\r\n" .
return mail(
 
$this->_aCfg['email']['to'],
 
$sSubject, $this->_sMessage,
 
"From: " . $this->_aCfg['email']['from'] . "\r\n" .
"Reply-To: " . $this->_aCfg['email']['from'] . "\r\n"
"Reply-To: " . $this->_aCfg['email']['from'] . "\r\n"
);
);
}
}
@@ -57,15 +59,15 @@ class messenger {
@@ -57,15 +59,15 @@ class messenger {
}
}
/**
/**
* send a message to slack if _aCfg['slack'] exists
* send a message to slack if _aCfg['slack']['incomingurl'] exists
*/
*/
private function _sendToSlack(){
private function _sendToSlack(){
if (array_key_exists('slack', $this->_aCfg)) {
if (isset($this->_aCfg['slack']['incomingurl']) && $this->_aCfg['slack']['incomingurl']) {
require_once(__DIR__ . '/../../vendor/shooker/shooker.php');
require_once(__DIR__ . '/../../vendor/shooker/shooker.php');
$shkr = new Shooker();
$shkr = new Shooker();
$shkr->setupIncoming($this->_aCfg['slack']['incomingurl']);
$shkr->setupIncoming($this->_aCfg['slack']['incomingurl']);
$sUser=(array_key_exists('user', $this->_aCfg['slack'])? $this->_aCfg['slack']['user']: false);
$sUser=(isset($this->_aCfg['slack']['user'])? $this->_aCfg['slack']['user']: false);
$sIcon=(array_key_exists('icon', $this->_aCfg['slack'])? $this->_aCfg['slack']['icon']: false);
$sIcon=(isset($this->_aCfg['slack']['icon'])? $this->_aCfg['slack']['icon']: false);
return $shkr->sendMessage($this->_sMessage, $sUser, $sIcon);
return $shkr->sendMessage($this->_sMessage, $sUser, $sIcon);
}
}
return false;
return false;
Loading