summaryrefslogtreecommitdiffstats
path: root/lib/Command
diff options
context:
space:
mode:
authorSean Molenaar <sean@seanmolenaar.eu>2021-01-08 23:26:10 +0100
committerSean Molenaar <SMillerDev@users.noreply.github.com>2021-01-12 13:29:08 +0100
commit67b6c4e1b0a9fa0138eb897f8a19e5b85d705c29 (patch)
treee1eeaea2f2e9bd41a9ca9437109f0fe2f3306295 /lib/Command
parente5d56f2c2e4542fca98194620a30605aa9e14437 (diff)
Fix psalm issues
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
Diffstat (limited to 'lib/Command')
-rw-r--r--lib/Command/Config/FeedAdd.php2
-rw-r--r--lib/Command/Config/FeedDelete.php7
-rw-r--r--lib/Command/Config/FeedList.php2
-rw-r--r--lib/Command/Config/FolderAdd.php4
-rw-r--r--lib/Command/Config/FolderDelete.php5
-rw-r--r--lib/Command/Config/FolderList.php3
-rw-r--r--lib/Command/Config/OpmlExport.php4
-rw-r--r--lib/Command/ExploreGenerator.php3
-rw-r--r--lib/Command/ShowFeed.php2
-rw-r--r--lib/Command/Updater/AfterUpdate.php5
-rw-r--r--lib/Command/Updater/AllFeeds.php3
-rw-r--r--lib/Command/Updater/BeforeUpdate.php3
-rw-r--r--lib/Command/Updater/UpdateFeed.php5
13 files changed, 35 insertions, 13 deletions
diff --git a/lib/Command/Config/FeedAdd.php b/lib/Command/Config/FeedAdd.php
index 86121ad06..4b4279267 100644
--- a/lib/Command/Config/FeedAdd.php
+++ b/lib/Command/Config/FeedAdd.php
@@ -32,6 +32,8 @@ class FeedAdd extends Command
/**
* Configure command
+ *
+ * @return void
*/
protected function configure()
{
diff --git a/lib/Command/Config/FeedDelete.php b/lib/Command/Config/FeedDelete.php
index fae1abdb2..6773a6525 100644
--- a/lib/Command/Config/FeedDelete.php
+++ b/lib/Command/Config/FeedDelete.php
@@ -2,13 +2,10 @@
namespace OCA\News\Command\Config;
-use OCA\News\Db\Feed;
use OCA\News\Service\FeedServiceV2;
-use OCA\News\Service\FolderServiceV2;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class FeedDelete extends Command
@@ -27,6 +24,8 @@ class FeedDelete extends Command
/**
* Configure command
+ *
+ * @return void
*/
protected function configure()
{
@@ -47,7 +46,7 @@ class FeedDelete extends Command
protected function execute(InputInterface $input, OutputInterface $output): int
{
$user = $input->getArgument('user-id');
- $id = $input->getArgument('feed-id');
+ $id = (int) $input->getArgument('feed-id');
$this->feedService->delete($user, $id);
diff --git a/lib/Command/Config/FeedList.php b/lib/Command/Config/FeedList.php
index 3462ff5c8..41beb1bfc 100644
--- a/lib/Command/Config/FeedList.php
+++ b/lib/Command/Config/FeedList.php
@@ -28,6 +28,8 @@ class FeedList extends Command
/**
* Configure command
+ *
+ * @return void
*/
protected function configure()
{
diff --git a/lib/Command/Config/FolderAdd.php b/lib/Command/Config/FolderAdd.php
index 03ad72535..503d63a31 100644
--- a/lib/Command/Config/FolderAdd.php
+++ b/lib/Command/Config/FolderAdd.php
@@ -2,8 +2,6 @@
namespace OCA\News\Command\Config;
-use OCA\News\Db\Feed;
-use OCA\News\Service\FeedServiceV2;
use OCA\News\Service\FolderServiceV2;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
@@ -27,6 +25,8 @@ class FolderAdd extends Command
/**
* Configure command
+ *
+ * @return void
*/
protected function configure()
{
diff --git a/lib/Command/Config/FolderDelete.php b/lib/Command/Config/FolderDelete.php
index 397eda999..a80875682 100644
--- a/lib/Command/Config/FolderDelete.php
+++ b/lib/Command/Config/FolderDelete.php
@@ -2,14 +2,11 @@
namespace OCA\News\Command\Config;
-use OCA\News\Db\Feed;
use OCA\News\Service\Exceptions\ServiceException;
-use OCA\News\Service\FeedServiceV2;
use OCA\News\Service\FolderServiceV2;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class FolderDelete extends Command
@@ -28,6 +25,8 @@ class FolderDelete extends Command
/**
* Configure command
+ *
+ * @return void
*/
protected function configure()
{
diff --git a/lib/Command/Config/FolderList.php b/lib/Command/Config/FolderList.php
index 6340f4d57..158747be5 100644
--- a/lib/Command/Config/FolderList.php
+++ b/lib/Command/Config/FolderList.php
@@ -3,7 +3,6 @@
namespace OCA\News\Command\Config;
use OCA\News\Controller\ApiPayloadTrait;
-use OCA\News\Service\FeedServiceV2;
use OCA\News\Service\FolderServiceV2;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
@@ -29,6 +28,8 @@ class FolderList extends Command
/**
* Configure command
+ *
+ * @return void
*/
protected function configure()
{
diff --git a/lib/Command/Config/OpmlExport.php b/lib/Command/Config/OpmlExport.php
index f51aed555..eec93ddbf 100644
--- a/lib/Command/Config/OpmlExport.php
+++ b/lib/Command/Config/OpmlExport.php
@@ -24,6 +24,8 @@ class OpmlExport extends Command
/**
* Configure command
+ *
+ * @return void
*/
protected function configure()
{
@@ -38,7 +40,7 @@ class OpmlExport extends Command
* @param InputInterface $input
* @param OutputInterface $output
*
- * @return int|void
+ * @return int
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
diff --git a/lib/Command/ExploreGenerator.php b/lib/Command/ExploreGenerator.php
index 65c206c5e..01ef2a866 100644
--- a/lib/Command/ExploreGenerator.php
+++ b/lib/Command/ExploreGenerator.php
@@ -44,6 +44,9 @@ class ExploreGenerator extends Command
parent::__construct();
}
+ /**
+ * @return void
+ */
protected function configure()
{
$result = [
diff --git a/lib/Command/ShowFeed.php b/lib/Command/ShowFeed.php
index 0016470e6..4e3084322 100644
--- a/lib/Command/ShowFeed.php
+++ b/lib/Command/ShowFeed.php
@@ -41,6 +41,8 @@ class ShowFeed extends Command
/**
* Configure the command
+ *
+ * @return void
*/
protected function configure()
{
diff --git a/lib/Command/Updater/AfterUpdate.php b/lib/Command/Updater/AfterUpdate.php
index 62ceb2710..bedc8c9ff 100644
--- a/lib/Command/Updater/AfterUpdate.php
+++ b/lib/Command/Updater/AfterUpdate.php
@@ -35,6 +35,9 @@ class AfterUpdate extends Command
$this->itemService = $itemService;
}
+ /**
+ * @return void
+ */
protected function configure()
{
$this->setName('news:updater:after-update')
@@ -44,7 +47,7 @@ class AfterUpdate extends Command
protected function execute(InputInterface $input, OutputInterface $output): int
{
- $count = $input->getArgument('purge_count');
+ $count = (int) $input->getArgument('purge_count');
$output->writeln($this->itemService->purgeOverThreshold($count));
diff --git a/lib/Command/Updater/AllFeeds.php b/lib/Command/Updater/AllFeeds.php
index 942b5706d..384508d7d 100644
--- a/lib/Command/Updater/AllFeeds.php
+++ b/lib/Command/Updater/AllFeeds.php
@@ -40,6 +40,9 @@ class AllFeeds extends Command
$this->feedService = $feedService;
}
+ /**
+ * @return void
+ */
protected function configure()
{
$json = '{"feeds": [{"id": 39, "userId": "john"}, // etc ]}';
diff --git a/lib/Command/Updater/BeforeUpdate.php b/lib/Command/Updater/BeforeUpdate.php
index 787125c32..605a2c9ee 100644
--- a/lib/Command/Updater/BeforeUpdate.php
+++ b/lib/Command/Updater/BeforeUpdate.php
@@ -29,6 +29,9 @@ class BeforeUpdate extends Command
$this->updaterService = $updater;
}
+ /**
+ * @return void
+ */
protected function configure()
{
$this->setName('news:updater:before-update')
diff --git a/lib/Command/Updater/UpdateFeed.php b/lib/Command/Updater/UpdateFeed.php
index 4ffb8f57a..401ae7199 100644
--- a/lib/Command/Updater/UpdateFeed.php
+++ b/lib/Command/Updater/UpdateFeed.php
@@ -30,6 +30,9 @@ class UpdateFeed extends Command
$this->feedService = $feedService;
}
+ /**
+ * @return void
+ */
protected function configure()
{
$this->setName('news:updater:update-feed')
@@ -48,8 +51,8 @@ class UpdateFeed extends Command
protected function execute(InputInterface $input, OutputInterface $output): int
{
- $feedId = $input->getArgument('feed-id');
$userId = $input->getArgument('user-id');
+ $feedId = (int) $input->getArgument('feed-id');
try {
$feed = $this->feedService->find($userId, $feedId);
$updated_feed = $this->feedService->fetch($feed);