- Fixes code style
This commit is contained in:
@ -25,13 +25,10 @@ class TaskScheduler {
|
||||
switch($this->method) {
|
||||
case self::METHOD_MAILPOET:
|
||||
return $this->configureMailpoetScheduler();
|
||||
break;
|
||||
case self::METHOD_WORDPRESS:
|
||||
return $this->configureWordpressScheduler();
|
||||
break;
|
||||
default:
|
||||
throw new \Exception(__("Task scheduler is not configured"));
|
||||
break;
|
||||
};
|
||||
} catch(\Exception $e) {
|
||||
// ignore exceptions as they should not prevent the rest of the site from loading
|
||||
@ -41,7 +38,6 @@ class TaskScheduler {
|
||||
function configureMailpoetScheduler() {
|
||||
$supervisor = new Supervisor();
|
||||
$supervisor->checkDaemon();
|
||||
return;
|
||||
}
|
||||
|
||||
function configureWordpressScheduler() {
|
||||
@ -60,7 +56,6 @@ class TaskScheduler {
|
||||
if($cron_daemon) {
|
||||
CronHelper::deleteDaemon();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
static function getAvailableMethods() {
|
||||
|
@ -66,7 +66,7 @@ class MailChimp {
|
||||
$connection = @fopen($url, 'r');
|
||||
if(!$connection) {
|
||||
return $this->processError('connection');
|
||||
} else {
|
||||
}
|
||||
$i = 0;
|
||||
$header = array();
|
||||
while(!feof($connection)) {
|
||||
@ -90,20 +90,16 @@ class MailChimp {
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
$bytes_fetched += strlen($buffer);
|
||||
if($bytes_fetched > $this->max_post_size) {
|
||||
return $this->processError('size');
|
||||
|
||||
}
|
||||
}
|
||||
fclose($connection);
|
||||
}
|
||||
}
|
||||
|
||||
if(!count($subscribers)) {
|
||||
return $this->processError('subscribers');
|
||||
|
||||
}
|
||||
|
||||
return array(
|
||||
@ -130,7 +126,7 @@ class MailChimp {
|
||||
}
|
||||
|
||||
function processError($error) {
|
||||
switch ($error) {
|
||||
switch($error) {
|
||||
case 'API':
|
||||
$errorMessage = __('Invalid API Key.');
|
||||
break;
|
||||
|
Reference in New Issue
Block a user