summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2015-08-07 13:51:36 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2015-08-07 13:51:36 +0200
commit49c27d13e551754368822ca39efab503a86108bf (patch)
treeafd3a8991aaa47ecb4deb690c51116132e70ce55
parente9c10e419604ec07a2305540d2800c93ee413067 (diff)
more ::class migrations and fix user deletion hook
-rw-r--r--admin/admin.php4
-rw-r--r--appinfo/register_command.php2
-rw-r--r--cron/updater.php10
-rw-r--r--hooks/user.php10
-rw-r--r--tests/integration/bootstrap.php8
5 files changed, 17 insertions, 17 deletions
diff --git a/admin/admin.php b/admin/admin.php
index 2ecc281e2..4e830af40 100644
--- a/admin/admin.php
+++ b/admin/admin.php
@@ -17,6 +17,6 @@ use OCA\News\AppInfo\Application;
$app = new Application();
$container = $app->getContainer();
-$response = $container->query('OCA\News\Controller\AdminController')->index();
+$response = $container->query(\OCA\News\Controller\AdminController::class)->index();
-return $response->render(); \ No newline at end of file
+return $response->render();
diff --git a/appinfo/register_command.php b/appinfo/register_command.php
index 4dc9228c8..a5df5531a 100644
--- a/appinfo/register_command.php
+++ b/appinfo/register_command.php
@@ -11,6 +11,6 @@
$newsApp = new OCA\News\AppInfo\Application();
$newsContainer = $newsApp->getContainer();
-$newsCmd = $newsContainer->query('OCA\News\Command\GenerateSearchIndices');
+$newsCmd = $newsContainer->query(\OCA\News\Command\GenerateSearchIndices::class);
$application->add($newsCmd);
diff --git a/cron/updater.php b/cron/updater.php
index 1abad75d4..cc44ffee8 100644
--- a/cron/updater.php
+++ b/cron/updater.php
@@ -14,7 +14,7 @@
namespace OCA\News\Cron;
-use \OCA\News\AppInfo\Application;
+use OCA\News\AppInfo\Application;
class Updater {
@@ -27,10 +27,10 @@ class Updater {
// make it possible to turn off cron updates if you use an external
// script to execute updates in parallel
- if ($container->query('OCA\News\Config\Config')->getUseCronUpdates()) {
- $container->query('OCA\News\Utility\Updater')->beforeUpdate();
- $container->query('OCA\News\Utility\Updater')->update();
- $container->query('OCA\News\Utility\Updater')->afterUpdate();
+ if ($container->query(\OCA\News\Config\Config:class)->getUseCronUpdates()) {
+ $container->query(\OCA\News\Utility\Updater:class)->beforeUpdate();
+ $container->query(\OCA\News\Utility\Updater:class)->update();
+ $container->query(\OCA\News\Utility\Updater:class)->afterUpdate();
}
}
diff --git a/hooks/user.php b/hooks/user.php
index 8ad12e880..e31c0756a 100644
--- a/hooks/user.php
+++ b/hooks/user.php
@@ -13,7 +13,7 @@
namespace OCA\News\Hooks;
-use \OCA\News\AppInfo\Application;
+use OCA\News\AppInfo\Application;
class User {
@@ -26,10 +26,10 @@ class User {
$container = $app->getContainer();
// order is important!
- $container->query('ItemService')->deleteUser($userId);
- $container->query('FeedService')->deleteUser($userId);
- $container->query('FolderService')->deleteUser($userId);
+ $container->query(\OCA\News\Service\ItemService::class)->deleteUser($userId);
+ $container->query(\OCA\News\Service\FeedService::class)->deleteUser($userId);
+ $container->query(\OCA\News\Service\FolderService::class)->deleteUser($userId);
}
-} \ No newline at end of file
+}
diff --git a/tests/integration/bootstrap.php b/tests/integration/bootstrap.php
index 559cda7eb..badb0f788 100644
--- a/tests/integration/bootstrap.php
+++ b/tests/integration/bootstrap.php
@@ -27,9 +27,9 @@ class NewsIntegrationTest extends \PHPUnit_Framework_TestCase {
$app = new Application();
$this->container = $app->getContainer();
- $this->itemMapper = $this->container->query('OCA\News\Db\ItemMapper');
- $this->feedMapper = $this->container->query('OCA\News\Db\FeedMapper');
- $this->folderMapper = $this->container->query('OCA\News\Db\FolderMapper');
+ $this->itemMapper = $this->container->query(\OCA\News\Db\ItemMapper::class);
+ $this->feedMapper = $this->container->query(\OCA\News\Db\FeedMapper::class);
+ $this->folderMapper = $this->container->query(\OCA\News\Db\FolderMapper::class);
$this->loadFixtures(
$this->folderMapper,
@@ -193,4 +193,4 @@ class NewsIntegrationTest extends \PHPUnit_Framework_TestCase {
}
-} \ No newline at end of file
+}