summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBenjamin Brahmer <info@b-brahmer.de>2022-08-19 10:07:43 +0200
committerGitHub <noreply@github.com>2022-08-19 10:07:43 +0200
commit1784406fa770abb066f9e7d9714e2ca49b9b0aae (patch)
treebb8da1f9d5981e6d65ded4d74189755a2aad7559 /lib
parentc09cca75b50d94b2d0d14f43b1136527364573d0 (diff)
Fix deprecation warnings from Nextcloud. (#1869)
* don't use private class anymore * execute is deprecated * fix migration execute statement * fix unittest Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/Cron/UpdaterJob.php7
-rw-r--r--lib/Db/NewsMapperV2.php2
-rw-r--r--lib/Migration/Version150005Date20201009192341.php2
3 files changed, 7 insertions, 4 deletions
diff --git a/lib/Cron/UpdaterJob.php b/lib/Cron/UpdaterJob.php
index 4675d6de7..44bb7bfa3 100644
--- a/lib/Cron/UpdaterJob.php
+++ b/lib/Cron/UpdaterJob.php
@@ -11,7 +11,8 @@
namespace OCA\News\Cron;
-use OC\BackgroundJob\TimedJob;
+use OCP\BackgroundJob\TimedJob;
+use OCP\AppFramework\Utility\ITimeFactory;
use OCA\News\AppInfo\Application;
use OCA\News\Service\StatusService;
@@ -35,10 +36,12 @@ class UpdaterJob extends TimedJob
private $updaterService;
public function __construct(
+ ITimeFactory $time,
IConfig $config,
StatusService $status,
UpdaterService $updaterService
) {
+ parent::__construct($time);
$this->config = $config;
$this->statusService = $status;
$this->updaterService = $updaterService;
@@ -49,7 +52,7 @@ class UpdaterJob extends TimedJob
Application::DEFAULT_SETTINGS['updateInterval']
);
- parent::setInterval($interval);
+ $this->setInterval($interval);
}
/**
diff --git a/lib/Db/NewsMapperV2.php b/lib/Db/NewsMapperV2.php
index b33266f8b..36f5aaed5 100644
--- a/lib/Db/NewsMapperV2.php
+++ b/lib/Db/NewsMapperV2.php
@@ -100,7 +100,7 @@ abstract class NewsMapperV2 extends QBMapper
->setParameter('deleted_at', $oldestDelete);
}
- $builder->execute();
+ $builder->executeStatement();
}
/**
diff --git a/lib/Migration/Version150005Date20201009192341.php b/lib/Migration/Version150005Date20201009192341.php
index 00d2d9553..7d739603b 100644
--- a/lib/Migration/Version150005Date20201009192341.php
+++ b/lib/Migration/Version150005Date20201009192341.php
@@ -36,7 +36,7 @@ class Version150005Date20201009192341 extends SimpleMigrationStep {
$qb->update('news_feeds')
->set('folder_id', $qb->createPositionalParameter(null, IQueryBuilder::PARAM_NULL))
->where('folder_id = 0')
- ->execute();
+ ->executeStatement();
$feed_name = $this->connection->getQueryBuilder()->getTableName('news_feeds');
$folder_name = $this->connection->getQueryBuilder()->getTableName('news_folders');