From 5b94705cf3918dc7986c6043b1fbe776bf22958f Mon Sep 17 00:00:00 2001 From: Sean Molenaar Date: Tue, 27 Mar 2018 15:35:06 +0200 Subject: Core: Fix compatibility with nextcloud codestyle (#280) --- lib/Utility/OPMLExporter.php | 25 ++++++++++++++----------- lib/Utility/PicoFeedClientFactory.php | 18 +++++++++++------- lib/Utility/PicoFeedFaviconFactory.php | 18 +++++++++++------- lib/Utility/ProxyConfigParser.php | 18 +++++++++++------- lib/Utility/Time.php | 11 +++++++---- lib/Utility/Updater.php | 25 +++++++++++++++---------- 6 files changed, 69 insertions(+), 46 deletions(-) (limited to 'lib/Utility') diff --git a/lib/Utility/OPMLExporter.php b/lib/Utility/OPMLExporter.php index fc6d9fd44..695eeac0b 100644 --- a/lib/Utility/OPMLExporter.php +++ b/lib/Utility/OPMLExporter.php @@ -5,27 +5,29 @@ * This file is licensed under the Affero General Public License version 3 or * later. See the COPYING file. * - * @author Alessandro Cosentino - * @author Bernhard Posselt - * @copyright Alessandro Cosentino 2012 - * @copyright Bernhard Posselt 2012, 2014 + * @author Alessandro Cosentino + * @author Bernhard Posselt + * @copyright 2012 Alessandro Cosentino + * @copyright 2012-2014 Bernhard Posselt */ namespace OCA\News\Utility; /** -* Exports the OPML -*/ -class OPMLExporter { + * Exports the OPML + */ +class OPMLExporter +{ /** * Generates the OPML for the active user * - * @param \OCA\News\Db\Folder[] $folders - * @param \OCA\News\Db\Feed[] $feeds + * @param \OCA\News\Db\Folder[] $folders + * @param \OCA\News\Db\Feed[] $feeds * @return \DomDocument the document */ - public function build($folders, $feeds){ + public function build($folders, $feeds) + { $document = new \DomDocument('1.0', 'UTF-8'); $document->formatOutput = true; @@ -76,7 +78,8 @@ class OPMLExporter { } - protected function createFeedOutline($feed, $document) { + protected function createFeedOutline($feed, $document) + { $feedOutline = $document->createElement('outline'); $feedOutline->setAttribute('title', $feed->getTitle()); $feedOutline->setAttribute('text', $feed->getTitle()); diff --git a/lib/Utility/PicoFeedClientFactory.php b/lib/Utility/PicoFeedClientFactory.php index 8e2cc6059..4593d5ff7 100644 --- a/lib/Utility/PicoFeedClientFactory.php +++ b/lib/Utility/PicoFeedClientFactory.php @@ -5,10 +5,10 @@ * This file is licensed under the Affero General Public License version 3 or * later. See the COPYING file. * - * @author Alessandro Cosentino - * @author Bernhard Posselt - * @copyright Alessandro Cosentino 2012 - * @copyright Bernhard Posselt 2012, 2014 + * @author Alessandro Cosentino + * @author Bernhard Posselt + * @copyright 2012 Alessandro Cosentino + * @copyright 2012-2014 Bernhard Posselt */ @@ -17,20 +17,24 @@ namespace OCA\News\Utility; use \PicoFeed\Config\Config; use \PicoFeed\Client\Client; -class PicoFeedClientFactory { +class PicoFeedClientFactory +{ private $config; - public function __construct(Config $config) { + public function __construct(Config $config) + { $this->config = $config; } /** * Returns a new instance of an PicoFeed Http client + * * @return \PicoFeed\Client instance */ - public function build() { + public function build() + { $client = Client::getInstance(); $client->setConfig($this->config); return $client; diff --git a/lib/Utility/PicoFeedFaviconFactory.php b/lib/Utility/PicoFeedFaviconFactory.php index e07b828c4..0f24cbb78 100644 --- a/lib/Utility/PicoFeedFaviconFactory.php +++ b/lib/Utility/PicoFeedFaviconFactory.php @@ -5,10 +5,10 @@ * This file is licensed under the Affero General Public License version 3 or * later. See the COPYING file. * - * @author Alessandro Cosentino - * @author Bernhard Posselt - * @copyright Alessandro Cosentino 2012 - * @copyright Bernhard Posselt 2012, 2014 + * @author Alessandro Cosentino + * @author Bernhard Posselt + * @copyright 2012 Alessandro Cosentino + * @copyright 2012-2014 Bernhard Posselt */ @@ -17,20 +17,24 @@ namespace OCA\News\Utility; use \PicoFeed\Config\Config; use \PicoFeed\Reader\Favicon; -class PicoFeedFaviconFactory { +class PicoFeedFaviconFactory +{ private $config; - public function __construct(Config $config) { + public function __construct(Config $config) + { $this->config = $config; } /** * Returns a new instance of an PicoFeed Http client + * * @return \PicoFeed\Favicon instance */ - public function build() { + public function build() + { return new Favicon($this->config); } diff --git a/lib/Utility/ProxyConfigParser.php b/lib/Utility/ProxyConfigParser.php index b8d7515ff..cada79576 100644 --- a/lib/Utility/ProxyConfigParser.php +++ b/lib/Utility/ProxyConfigParser.php @@ -5,10 +5,10 @@ * This file is licensed under the Affero General Public License version 3 or * later. See the COPYING file. * - * @author Alessandro Cosentino - * @author Bernhard Posselt - * @copyright Alessandro Cosentino 2012 - * @copyright Bernhard Posselt 2012, 2014 + * @author Alessandro Cosentino + * @author Bernhard Posselt + * @copyright 2012 Alessandro Cosentino + * @copyright 2012-2014 Bernhard Posselt */ @@ -17,20 +17,24 @@ namespace OCA\News\Utility; use \OCP\IConfig; -class ProxyConfigParser { +class ProxyConfigParser +{ private $config; - public function __construct(IConfig $config) { + public function __construct(IConfig $config) + { $this->config = $config; } /** * Parses the config and splits up the port + url + * * @return array */ - public function parse() { + public function parse() + { $proxy = $this->config->getSystemValue('proxy'); $userpasswd = $this->config->getSystemValue('proxyuserpwd'); diff --git a/lib/Utility/Time.php b/lib/Utility/Time.php index c46dbd524..2823e85d8 100644 --- a/lib/Utility/Time.php +++ b/lib/Utility/Time.php @@ -6,20 +6,23 @@ * later. See the COPYING file. * * @author Bernhard Posselt - * @copyright Bernhard Posselt 2016 + * @copyright 2016 Bernhard Posselt */ namespace OCA\News\Utility; -class Time { - public function getTime() { +class Time +{ + public function getTime() + { return 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 7a7f11e92..5f9edbeda 100644 --- a/lib/Utility/Updater.php +++ b/lib/Utility/Updater.php @@ -5,10 +5,10 @@ * This file is licensed under the Affero General Public License version 3 or * later. See the COPYING file. * - * @author Alessandro Cosentino - * @author Bernhard Posselt - * @copyright Alessandro Cosentino 2012 - * @copyright Bernhard Posselt 2012, 2014 + * @author Alessandro Cosentino + * @author Bernhard Posselt + * @copyright 2012 Alessandro Cosentino + * @copyright 2012-2014 Bernhard Posselt */ @@ -19,7 +19,8 @@ use \OCA\News\Service\FeedService; use \OCA\News\Service\ItemService; -class Updater { +class Updater +{ private $folderService; @@ -27,26 +28,30 @@ class Updater { private $itemService; public function __construct(FolderService $folderService, - FeedService $feedService, - ItemService $itemService) { + FeedService $feedService, + ItemService $itemService + ) { $this->folderService = $folderService; $this->feedService = $feedService; $this->itemService = $itemService; } - 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(); } -- cgit v1.2.3