summaryrefslogtreecommitdiffstats
path: root/lib/Service
diff options
context:
space:
mode:
authorBenjamin Brahmer <info@b-brahmer.de>2021-01-06 20:16:33 +0100
committerSean Molenaar <SMillerDev@users.noreply.github.com>2021-01-08 22:45:10 +0100
commit7180e11bdb3f27a1a282a137ca95279b39944b5b (patch)
tree17fd8152b8fabcb760395b45b5e47e66022304a9 /lib/Service
parentcc582c5dc8f5c5ec7052f4e2cab8530b9307afaa (diff)
fixes done by psalm
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Diffstat (limited to 'lib/Service')
-rw-r--r--lib/Service/FolderServiceV2.php4
-rw-r--r--lib/Service/ImportService.php4
-rw-r--r--lib/Service/ItemService.php44
-rw-r--r--lib/Service/UpdaterService.php6
4 files changed, 38 insertions, 20 deletions
diff --git a/lib/Service/FolderServiceV2.php b/lib/Service/FolderServiceV2.php
index 25903c17b..c60d13172 100644
--- a/lib/Service/FolderServiceV2.php
+++ b/lib/Service/FolderServiceV2.php
@@ -116,8 +116,10 @@ class FolderServiceV2 extends Service
*
* @param string|null $userID The user to purge
* @param int|null $minTimestamp The timestamp to purge from
+ *
+ * @return void
*/
- public function purgeDeleted(?string $userID, ?int $minTimestamp)
+ public function purgeDeleted(?string $userID, ?int $minTimestamp): void
{
$this->mapper->purgeDeleted($userID, $minTimestamp);
}
diff --git a/lib/Service/ImportService.php b/lib/Service/ImportService.php
index c3334fad2..e7b6ab7be 100644
--- a/lib/Service/ImportService.php
+++ b/lib/Service/ImportService.php
@@ -71,9 +71,9 @@ class ImportService
* @param string $userId
* @param array $json
*
- * @return array|null
+ * @return \OCP\AppFramework\Db\Entity|null
*/
- public function importArticles(string $userId, array $json)
+ public function importArticles(string $userId, array $json): ?\OCP\AppFramework\Db\Entity
{
$url = 'http://nextcloud/nofeed';
diff --git a/lib/Service/ItemService.php b/lib/Service/ItemService.php
index 1b459d49c..70f89cfc2 100644
--- a/lib/Service/ItemService.php
+++ b/lib/Service/ItemService.php
@@ -172,14 +172,17 @@ class ItemService extends Service
/**
* Star or unstar an item
*
- * @param int $feedId the id of the item's feed that should be starred
- * @param string $guidHash the guidHash of the item that should be starred
- * @param boolean $isStarred if true the item will be marked as starred,
+ * @param int $feedId the id of the item's feed that should be starred
+ * @param string $guidHash the guidHash of the item that should be starred
+ * @param boolean $isStarred if true the item will be marked as starred,
* if false unstar
- * @param string $userId the name of the user for security reasons
+ * @param string $userId the name of the user for security reasons
+ *
* @throws ServiceNotFoundException if the item does not exist
+ *
+ * @return void
*/
- public function star($feedId, $guidHash, $isStarred, $userId)
+ public function star($feedId, $guidHash, $isStarred, $userId): void
{
try {
$item = $this->mapper->findByGuidHash($feedId, $guidHash);
@@ -196,13 +199,16 @@ class ItemService extends Service
/**
* Read or unread an item
*
- * @param int $itemId the id of the item that should be read
- * @param boolean $isRead if true the item will be marked as read,
+ * @param int $itemId the id of the item that should be read
+ * @param boolean $isRead if true the item will be marked as read,
* if false unread
- * @param string $userId the name of the user for security reasons
+ * @param string $userId the name of the user for security reasons
+ *
* @throws ServiceNotFoundException if the item does not exist
+ *
+ * @return void
*/
- public function read($itemId, $isRead, $userId)
+ public function read($itemId, $isRead, $userId): void
{
try {
$lastModified = $this->timeFactory->getMicroTime();
@@ -220,8 +226,10 @@ class ItemService extends Service
* used to prevent marking items as read that
* the users hasn't seen yet
* @param string $userId the name of the user
+ *
+ * @return void
*/
- public function readAll($highestItemId, $userId)
+ public function readAll($highestItemId, $userId): void
{
$time = $this->timeFactory->getMicroTime();
$this->oldItemMapper->readAll($highestItemId, $time, $userId);
@@ -236,8 +244,10 @@ class ItemService extends Service
* used to prevent marking items as read that
* the users hasn't seen yet
* @param string $userId the name of the user
+ *
+ * @return void
*/
- public function readFolder(?int $folderId, $highestItemId, $userId)
+ public function readFolder(?int $folderId, $highestItemId, $userId): void
{
$time = $this->timeFactory->getMicroTime();
$this->oldItemMapper->readFolder(
@@ -257,8 +267,10 @@ class ItemService extends Service
* used to prevent marking items as read that
* the users hasn't seen yet
* @param string $userId the name of the user
+ *
+ * @return void
*/
- public function readFeed($feedId, $highestItemId, $userId)
+ public function readFeed($feedId, $highestItemId, $userId): void
{
$time = $this->timeFactory->getMicroTime();
$this->oldItemMapper->readFeed($feedId, $highestItemId, $time, $userId);
@@ -270,8 +282,10 @@ class ItemService extends Service
* count of $this->autoPurgeCount starting by the oldest. This is to clean
* up the database so that old entries don't spam your db. As criteria for
* old, the id is taken
+ *
+ * @return void
*/
- public function autoPurgeOld()
+ public function autoPurgeOld(): void
{
$count = $this->config->getAppValue(
Application::NAME,
@@ -325,8 +339,10 @@ class ItemService extends Service
/**
* Regenerates the search index for all items
+ *
+ * @return void
*/
- public function generateSearchIndices()
+ public function generateSearchIndices(): void
{
$this->oldItemMapper->updateSearchIndices();
}
diff --git a/lib/Service/UpdaterService.php b/lib/Service/UpdaterService.php
index bc7c9f562..cf18e0c73 100644
--- a/lib/Service/UpdaterService.php
+++ b/lib/Service/UpdaterService.php
@@ -43,20 +43,20 @@ class UpdaterService
}
- public function beforeUpdate()
+ public function beforeUpdate(): void
{
$this->folderService->purgeDeleted(null, null);
$this->feedService->purgeDeleted(null, null);
}
- public function update()
+ public function update(): void
{
$this->feedService->fetchAll();
}
- public function afterUpdate()
+ public function afterUpdate(): void
{
$this->itemService->purgeOverThreshold(null);
}