- Fixes code style

This commit is contained in:
Vlad
2016-07-21 10:52:23 -04:00
parent 067b3ff3e6
commit 41ad86ba1f
2 changed files with 30 additions and 39 deletions

View File

@ -25,13 +25,10 @@ class TaskScheduler {
switch($this->method) { switch($this->method) {
case self::METHOD_MAILPOET: case self::METHOD_MAILPOET:
return $this->configureMailpoetScheduler(); return $this->configureMailpoetScheduler();
break;
case self::METHOD_WORDPRESS: case self::METHOD_WORDPRESS:
return $this->configureWordpressScheduler(); return $this->configureWordpressScheduler();
break;
default: default:
throw new \Exception(__("Task scheduler is not configured")); throw new \Exception(__("Task scheduler is not configured"));
break;
}; };
} catch(\Exception $e) { } catch(\Exception $e) {
// ignore exceptions as they should not prevent the rest of the site from loading // ignore exceptions as they should not prevent the rest of the site from loading
@ -41,7 +38,6 @@ class TaskScheduler {
function configureMailpoetScheduler() { function configureMailpoetScheduler() {
$supervisor = new Supervisor(); $supervisor = new Supervisor();
$supervisor->checkDaemon(); $supervisor->checkDaemon();
return;
} }
function configureWordpressScheduler() { function configureWordpressScheduler() {
@ -60,7 +56,6 @@ class TaskScheduler {
if($cron_daemon) { if($cron_daemon) {
CronHelper::deleteDaemon(); CronHelper::deleteDaemon();
} }
return;
} }
static function getAvailableMethods() { static function getAvailableMethods() {

View File

@ -66,7 +66,7 @@ class MailChimp {
$connection = @fopen($url, 'r'); $connection = @fopen($url, 'r');
if(!$connection) { if(!$connection) {
return $this->processError('connection'); return $this->processError('connection');
} else { }
$i = 0; $i = 0;
$header = array(); $header = array();
while(!feof($connection)) { while(!feof($connection)) {
@ -90,20 +90,16 @@ class MailChimp {
} }
$i++; $i++;
} }
$bytes_fetched += strlen($buffer); $bytes_fetched += strlen($buffer);
if($bytes_fetched > $this->max_post_size) { if($bytes_fetched > $this->max_post_size) {
return $this->processError('size'); return $this->processError('size');
} }
} }
fclose($connection); fclose($connection);
} }
}
if(!count($subscribers)) { if(!count($subscribers)) {
return $this->processError('subscribers'); return $this->processError('subscribers');
} }
return array( return array(