From becce6b7520912257c3d72697a3aefec9923a467 Mon Sep 17 00:00:00 2001 From: Sean Molenaar Date: Thu, 29 Nov 2018 20:59:46 +0100 Subject: Define an official codestyle and adhere to it. --- lib/Utility/OPMLExporter.php | 5 +---- lib/Utility/PicoFeedClientFactory.php | 8 +++----- lib/Utility/PicoFeedFaviconFactory.php | 8 +++----- lib/Utility/ProxyConfigParser.php | 9 +++------ lib/Utility/Time.php | 5 ++--- lib/Utility/Updater.php | 14 ++++++-------- 6 files changed, 18 insertions(+), 31 deletions(-) (limited to 'lib/Utility') diff --git a/lib/Utility/OPMLExporter.php b/lib/Utility/OPMLExporter.php index 19bb76ad7..189cf8d1e 100644 --- a/lib/Utility/OPMLExporter.php +++ b/lib/Utility/OPMLExporter.php @@ -48,7 +48,7 @@ class OPMLExporter $body = $document->createElement('body'); // feeds with folders - foreach($folders as $folder) { + foreach ($folders as $folder) { $folderOutline = $document->createElement('outline'); $folderOutline->setAttribute('title', $folder->getName()); $folderOutline->setAttribute('text', $folder->getName()); @@ -94,7 +94,4 @@ class OPMLExporter $feedOutline->setAttribute('htmlUrl', $feed->getLink()); return $feedOutline; } - - } - diff --git a/lib/Utility/PicoFeedClientFactory.php b/lib/Utility/PicoFeedClientFactory.php index 4593d5ff7..046224919 100644 --- a/lib/Utility/PicoFeedClientFactory.php +++ b/lib/Utility/PicoFeedClientFactory.php @@ -22,7 +22,7 @@ class PicoFeedClientFactory private $config; - public function __construct(Config $config) + public function __construct(Config $config) { $this->config = $config; } @@ -33,12 +33,10 @@ class PicoFeedClientFactory * * @return \PicoFeed\Client instance */ - public function build() + public function build() { $client = Client::getInstance(); $client->setConfig($this->config); return $client; } - - -} \ No newline at end of file +} diff --git a/lib/Utility/PicoFeedFaviconFactory.php b/lib/Utility/PicoFeedFaviconFactory.php index 0f24cbb78..09a1b76c8 100644 --- a/lib/Utility/PicoFeedFaviconFactory.php +++ b/lib/Utility/PicoFeedFaviconFactory.php @@ -22,7 +22,7 @@ class PicoFeedFaviconFactory private $config; - public function __construct(Config $config) + public function __construct(Config $config) { $this->config = $config; } @@ -33,10 +33,8 @@ class PicoFeedFaviconFactory * * @return \PicoFeed\Favicon instance */ - public function build() + public function build() { return new Favicon($this->config); } - - -} \ No newline at end of file +} diff --git a/lib/Utility/ProxyConfigParser.php b/lib/Utility/ProxyConfigParser.php index cada79576..dc9bd3d8b 100644 --- a/lib/Utility/ProxyConfigParser.php +++ b/lib/Utility/ProxyConfigParser.php @@ -16,13 +16,12 @@ namespace OCA\News\Utility; use \OCP\IConfig; - class ProxyConfigParser { private $config; - public function __construct(IConfig $config) + public function __construct(IConfig $config) { $this->config = $config; } @@ -33,7 +32,7 @@ class ProxyConfigParser * * @return array */ - public function parse() + public function parse() { $proxy = $this->config->getSystemValue('proxy'); $userpasswd = $this->config->getSystemValue('proxyuserpwd'); @@ -64,6 +63,4 @@ class ProxyConfigParser return $result; } - - -} \ No newline at end of file +} diff --git a/lib/Utility/Time.php b/lib/Utility/Time.php index 2823e85d8..739204f6d 100644 --- a/lib/Utility/Time.php +++ b/lib/Utility/Time.php @@ -13,7 +13,7 @@ namespace OCA\News\Utility; class Time { - public function getTime() + public function getTime() { return time(); } @@ -21,10 +21,9 @@ class Time /** * @return int the current unix time in miliseconds */ - public function getMicroTime() + public function getMicroTime() { list($millisecs, $secs) = explode(" ", microtime()); return $secs . substr($millisecs, 2, 6); } - } diff --git a/lib/Utility/Updater.php b/lib/Utility/Updater.php index 5f9edbeda..02ede9c90 100644 --- a/lib/Utility/Updater.php +++ b/lib/Utility/Updater.php @@ -18,7 +18,6 @@ use \OCA\News\Service\FolderService; use \OCA\News\Service\FeedService; use \OCA\News\Service\ItemService; - class Updater { @@ -27,7 +26,8 @@ class Updater private $feedService; private $itemService; - public function __construct(FolderService $folderService, + public function __construct( + FolderService $folderService, FeedService $feedService, ItemService $itemService ) { @@ -37,23 +37,21 @@ class Updater } - public function beforeUpdate() + public function beforeUpdate() { $this->folderService->purgeDeleted(); $this->feedService->purgeDeleted(); } - public function update() + public function update() { $this->feedService->updateAll(); } - public function afterUpdate() + public function afterUpdate() { $this->itemService->autoPurgeOld(); } - - -} \ No newline at end of file +} -- cgit v1.2.3