summaryrefslogtreecommitdiffstats
path: root/lib/Utility
diff options
context:
space:
mode:
authorSean Molenaar <SMillerDev@users.noreply.github.com>2018-03-27 15:35:06 +0200
committerBernhard Posselt <BernhardPosselt@users.noreply.github.com>2018-03-27 15:35:06 +0200
commit5b94705cf3918dc7986c6043b1fbe776bf22958f (patch)
tree4e8059818a0a913d24938e35238913a721fa6373 /lib/Utility
parentf3c9d13551cef5968baea99c2f25085baee0ed5f (diff)
Core: Fix compatibility with nextcloud codestyle (#280)
Diffstat (limited to 'lib/Utility')
-rw-r--r--lib/Utility/OPMLExporter.php25
-rw-r--r--lib/Utility/PicoFeedClientFactory.php18
-rw-r--r--lib/Utility/PicoFeedFaviconFactory.php18
-rw-r--r--lib/Utility/ProxyConfigParser.php18
-rw-r--r--lib/Utility/Time.php11
-rw-r--r--lib/Utility/Updater.php25
6 files changed, 69 insertions, 46 deletions
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 <cosenal@gmail.com>
- * @author Bernhard Posselt <dev@bernhard-posselt.com>
- * @copyright Alessandro Cosentino 2012
- * @copyright Bernhard Posselt 2012, 2014
+ * @author Alessandro Cosentino <cosenal@gmail.com>
+ * @author Bernhard Posselt <dev@bernhard-posselt.com>
+ * @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 <cosenal@gmail.com>
- * @author Bernhard Posselt <dev@bernhard-posselt.com>
- * @copyright Alessandro Cosentino 2012
- * @copyright Bernhard Posselt 2012, 2014
+ * @author Alessandro Cosentino <cosenal@gmail.com>
+ * @author Bernhard Posselt <dev@bernhard-posselt.com>
+ * @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 <cosenal@gmail.com>
- * @author Bernhard Posselt <dev@bernhard-posselt.com>
- * @copyright Alessandro Cosentino 2012
- * @copyright Bernhard Posselt 2012, 2014
+ * @author Alessandro Cosentino <cosenal@gmail.com>
+ * @author Bernhard Posselt <dev@bernhard-posselt.com>
+ * @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 <cosenal@gmail.com>
- * @author Bernhard Posselt <dev@bernhard-posselt.com>
- * @copyright Alessandro Cosentino 2012
- * @copyright Bernhard Posselt 2012, 2014
+ * @author Alessandro Cosentino <cosenal@gmail.com>
+ * @author Bernhard Posselt <dev@bernhard-posselt.com>
+ * @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 <dev@bernhard-posselt.com>
- * @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 <cosenal@gmail.com>
- * @author Bernhard Posselt <dev@bernhard-posselt.com>
- * @copyright Alessandro Cosentino 2012
- * @copyright Bernhard Posselt 2012, 2014
+ * @author Alessandro Cosentino <cosenal@gmail.com>
+ * @author Bernhard Posselt <dev@bernhard-posselt.com>
+ * @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();
}